FTP bulk upload, ftput.sh:
01 #! / Bin / bash
02 for filename in $ @
03 do
04 ftp-nv 192.168.130.2 <
05 user username password
06 prompt off
07 bin
08 mput $ filename
09 close
10!
11 done
FTP batch download, ftpget.sh
01 #! / Bin / bash
02 for filename in $ @
03 do
04 ftp-nv 192.168.130.2 <
05 user username password
06 prompt off
07 bin
08 mget $ filename
09 close
10!
11 done
Application method: modify the code under the (FTP address and user name password change it) save as ftput.sh, the file to upload can be executed as a script argument. As
1 sh. / Ftput.sh *. jpg 123.txt config.xml
Is that all jpg files and upload the two files 23.txt config.xml to ftp.