Linux FTP備份文件

FTP.sh

#!/bin/bash
ftp -n <<- EOF
open <FTP Server IP地址>
user < FTP用戶名> <FTP密碼>
cd /full
bin
lcd /data/full
prompt
mget *
close
bye
EOF

del.sh

#!/bin/bash
disk=df -h|grep data|awk '{print $5}'|sed 's/.$//'
if [ "$disk" -gt "85" ];then
find /data/diff/ -type f -mtime +15 -exec rm {} \;
find /data/full/
-type f -mtime +15 -exec rm {} \;
fi

使用crontab -e命令,加入定時任務

30 00 /root/del_days.sh &
00 19
/root/full_download.sh &

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章