Ubuntu - 複製資料夾時出錯,資料夾末尾有空格錯誤

Ubuntu - 複製資料夾時出錯,資料夾末尾有空格錯誤

各位鍵盤俠們大家好。我有一個問題,有點要了我的命。情況:

  • vsftpd 伺服器具有以下設定檔(http://pastebin.com/8AVZ9WGK
  • 具有預設權限的家庭/用戶
  • file.sh 腳本執行以下操作:

    1. 下載 HTML 網頁並提取文件連結。
    2. 每一行建立一個目錄並將 N 個映像下載到以下目錄。

我的問題:使用 Windows 可以透過 Windows 上的 FTP 存取文件,使用 localUser 登入。我可以複製單個文件甚至同一資料夾中的多個文件。但是當我嘗試複製包含所有內容的資料夾時。 N個文件發生以下情況:https://i.stack.imgur.com/cHjlJ.jpg

如果我嘗試使用 Filezilla,我會收到以下錯誤:

Command: LIST
Response:   150 Here comes the directory listing.
Response:   226 Directory send OK.
Status: Directory listing successful
Status: Retrieving directory listing...
Command:    CWD FolderName completa
Response:   550 Failed to change directory.
Error:  Failed to retrieve directory listing

編輯1

ls -lat 主目錄

drwxrwxrwx   3 eco01 eco01 4096 Oct  7 14:57 .
drwxrwxr-x 130 eco01 eco01 4096 Oct  7 12:44 FolderName 
-rwxrwxrwx   1 eco01 eco01 1577 Oct  7 12:32 getM.sh
drwxrwxrwx  21 eco01 eco01 4096 Oct  7 11:47 ..

ls -lat 目錄內

drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 585
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 601
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 589
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 566
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 588
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 586
drwxrwxr-x   2 eco01 eco01  4096 Oct  7 12:44 Folder 587

答案1

經過數百萬次下載和測試。我找到了。事情的經過:

在腳本中,我從字元(“&”)中“剪切”了檔案名稱。

 nameCap=${nameCap%%&*}

發生的情況是,主資料夾和子資料夾是用空格和資料夾末尾(例如“FolderName”)建立的。子資料夾也發生同樣的情況。我只是添加,所以我刪除了我創建的資料夾的最後一個字元:

 nameCap="${nameCap%?}"

相關內容