Uploading all of files in my local directory with

2019-01-16 20:58发布

问题:

I want to upload all the files in one directory, and I know how to upload one file using curl like this :

curl -T "local/xxx.suffix" -u xxx:psw "ftp://192.168.1.158/public/demon_test/xxx.suffix"

How can I upload all the files (subdirectory) in the current directory to an FTP server?

回答1:

Use curl with find to recursively upload all files from a specific directory:

find mydir -type f -exec curl -u xxx:psw --ftp-create-dirs -T {} ftp://192.168.1.158/public/demon_test/{} \;


回答2:

instead of curl, use wput (not to be confused with wget).