FTP自動登錄批量下載文件
從ftp服務器192.168.1.171上的/home/data 到本地的/home/databackup
!/bin/bash
ftp -v -n 192.168.1.171
user guest 123456
binary
cd /home/data
lcd /home/databackup
prompt
mget *
close
bye
FTP自動登錄批量上傳文件
從ftp服務器192.168.1.171上的/home/data 到本地的/home/databackup
#!/bin/bash
ftp -v -n 192.168.1.171 << END
user guest 123456
binary
hash
cd /home/data
lcd /home/databackup
prompt
mput *
bye
END