备份脚本
touch uploadftp_dnbame.sh
#/bin/bash
#2018-0713
dbname = "DBName"
ftp -i -v -n <<!
open 192.168.1.114
user ftp_user ftp_password
binary
cd djhj
lcd /backup/
prompt
put ${dbname}${date +%F}.sql
close
buy
!
echo "$(date +%Y-%m-%d%H:%M:%S) Upload $(dbname) to FTP success !"
添加到计划任务
crontab -e
20 0 * /bin/bash /scripts/uploadftp_dnbame.sh
原文地址:http://blog.51cto.com/liaoxz/2141835
时间: 2024-11-03 03:44:44