利用了 bash 和 lftp 的自动登录功能 lftp 支持 ftp ssh 等多种登录协议
复制代码 代码如下:
#!/bin/bash
echo "script start at " `date "+%Y-%m-%d %H:%M:%S"`
for site in "192.168.1.2" "192.168.1.3"
do
echo $site
/usr/bin/lftp << EOF
open ftp://username:password@$site
get something -o localfilename
.... other get .................
EOF
done
echo "script end at " `date "+%Y-%m-%d %H:%M:%S"`
复制代码 代码如下:
#!/bin/bash
echo "script start at " `date "+%Y-%m-%d %H:%M:%S"`
for site in "192.168.1.2" "192.168.1.3"
do
echo $site
/usr/bin/lftp << EOF
open ftp://username:password@$site
get something -o localfilename
.... other get .................
EOF
done
echo "script end at " `date "+%Y-%m-%d %H:%M:%S"`