用lftp 定时增量下载整个目录中最新文件

#!/bin/sh

 

echo "===============================lftp backup start at `date "+%Y-%m-%d %H:%M:%S"`"

echo "lftp backup start at `date "+%Y-%m-%d %H:%M:%S"`" >> /opt/tulip_bak20170414/log/log_info.log

 

HOST="114.215.133.**:22"

USER="root"

PASS="g4056&*"

 

LCD="/opt/tulip_bak20170414/" #local path

RCD="/opt/test/tulip_test/tulip/tmp/BOOT-INF/classes" #remote path

 

lftp << EOF

 

lftp sftp://$USER:"$PASS"@$HOST

mirror -e -n -v $RCD $LCD 

 

EOF

 

echo "lftp backup end at `date "+%Y-%m-%d %H:%M:%S"`" >>  /opt/tulip_bak20170414/log/log_info.log

echo "===============================lftp backup end at `date "+%Y-%m-%d %H:%M:%S"`"

//定时执行

42 23 * * * /opt/tulip_bak20170414/backup.sh &

你可能感兴趣的:(linux)