标签:.sh 计划任务 lcd close code DBName scripts cron touch
备份脚本
#/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
标签:.sh 计划任务 lcd close code DBName scripts cron touch
原文地址:http://blog.51cto.com/liaoxz/2141835