"wput" mehrere Dateien von der Kommandozeile aus?

8176
dinkelk

Sie können eine einzelne Datei hochladen mit wput:

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

Gibt es eine Möglichkeit, mehrere hochzuladen? Vielleicht so etwas wie:

wput ftp://username:passwd@ipaddress/ 

Hinweis : Ich weiß, dass es Lösungen gibt ftp, die curl, und andere verwenden. Ich habe mich gefragt, ob es einen gibt wput.

6

1 Antwort auf die Frage

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.