"wput" несколько файлов из командной строки?

8074
dinkelk

Вы можете загрузить один файл с wput:

wput file ftp://username:passwd@ipaddress/file 

Есть ли способ загрузить несколько? Может быть что-то вроде:

wput ftp://username:passwd@ipaddress/ 

Примечание : Я знаю, что есть решения, использующие ftp, curlи другие. Мне было интересно, если есть один для wput.

6

1 ответ на вопрос

3
Endoro

From the manual:

So you can specify e.g. one URL and read all filenames from a file. Or use wput *.txt ftp://host, to transfer all *.txt-files. See EXAMPLES for further examples. 

−i file

−−input−file=file

Reads URLs and filenames from file. If there are URLs on the command-line too, these will be retrieved first, unless sorting is enabled. See also the URL-Input-Handling section. If file is −, the URLs will be read from stdin. If you want to pipe the contents of the file that shall be uploaded to stdin, this cannot be done (yet). But you can use the --input-pipe flag and read the contents a) from a named pipe -I "cat named.pipe; echo > /dev/null" or b) directly from the command, that outputs the data. (See --input-pipe) Do not do things like find | wput ftp://host/ −i −! Wput would upload all files from the current directory (since the first output of find will be ’.’) and afterwards each file again (since find postes its name to Wput. And further problematic is that Wput will upload each directory that is given by find and since find itself recurses all directories, the files would be uploaded three times (or even more often for further subdirectories). Use wput ftp://host/ to upload everything from the local directory. Or use find ! −type d | wput ftp://host/ −i − to tell find, not to output directories.

Похожие вопросы