Eu quero enviar um monte de arquivos da minha caixa para o meu servidor FTP. Não há problema se eu enviar o nome de arquivo completo, mas parece que o comando ftp não pode enviar arquivos com globbing de nome de arquivo. Aqui está o que eu fiz:
$ ftp 192.168.1.1
Connected to 192.168.1.1.
220 Welcome to ASUS DSL-N14U FTP service.
Name (192.168.1.1:osmc): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> !ls \[KaMi\]_\(Hi10\)_Bleach_-_26*
[KaMi]_(Hi10)_Bleach_-_260_(720p)_(ELEMENT).mkv
[KaMi]_(Hi10)_Bleach_-_261_(720p)_(BlazerSoul).mkv
[KaMi]_(Hi10)_Bleach_-_262_(720p)_(BlazerSoul).mkv
[KaMi]_(Hi10)_Bleach_-_263_(720p)_(BlazerSoul).mkv
[KaMi]_(Hi10)_Bleach_-_264_(720p)_(ELEMENT).mkv
[KaMi]_(Hi10)_Bleach_-_265_(720p)_(ELEMENT).mkv
[KaMi]_(Hi10)_Bleach_-_266_(720p)_(ELEMENT).mkv
[KaMi]_(Hi10)_Bleach_-_267_(720p)_(Flomp).mkv
[KaMi]_(Hi10)_Bleach_-_268_(720p)_(Flomp).mkv
[KaMi]_(Hi10)_Bleach_-_269_(720p)_(Flomp).mkv
ftp> mput \[KaMi\]_\(Hi10\)_Bleach_-_26*
mput [KaMi]_(Hi10)_Bleach_-_26*? y
local: [KaMi]_(Hi10)_Bleach_-_26*: No such file or directory
ftp>
Edit: Parece que o principal problema é com os caracteres especiais no nome do arquivo, como [], (e). Porque depois de renomeá-los, tudo correu bem:
$ for ((i=0;i<6;i++)); do mv \[KaMi\]_\(Hi10\)_Bleach_-_26$i* Bleach.26$i.S13E$((31+i)).mkv; done
$ ftp 192.168.1.1Connected to 192.168.1.1.
220 Welcome to ASUS DSL-N14U FTP service.
Name (192.168.1.1:osmc): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> prompt
ftp> !ls Bleach.26*
Bleach.260.S13E31.mkv Bleach.262.S13E33.mkv Bleach.264.S13E35.mkv
Bleach.261.S13E32.mkv Bleach.263.S13E34.mkv Bleach.265.S13E36.mkv
ftp> mput Bleach.26*
local: Bleach.260.S13E31.mkv remote: Bleach.260.S13E31.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
157916406 bytes sent in 14.56 secs (10.3431 MB/s)
local: Bleach.261.S13E32.mkv remote: Bleach.261.S13E32.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
115469065 bytes sent in 10.76 secs (10.2387 MB/s)
local: Bleach.262.S13E33.mkv remote: Bleach.262.S13E33.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
112886089 bytes sent in 11.04 secs (9.7521 MB/s)
local: Bleach.263.S13E34.mkv remote: Bleach.263.S13E34.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
156384088 bytes sent in 14.50 secs (10.2820 MB/s)
local: Bleach.264.S13E35.mkv remote: Bleach.264.S13E35.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
148707976 bytes sent in 14.04 secs (10.0982 MB/s)
local: Bleach.265.S13E36.mkv remote: Bleach.265.S13E36.mkv
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
161106339 bytes sent in 15.06 secs (10.2043 MB/s)
ftp>
Mas estou curioso para saber como fazer isso sem renomear.