lftp 贴心好友 备份服务器bash脚本
(编辑:jimmy 日期: 2024/11/9 浏览:3 次 )
利用了 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"`
下一篇:正确维护配置Apache服务器的方法 保护系统安全