@
princeofwales /root/
backup.sh 脚本这样:
#!/bin/bash
source /root/.bash_profile
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
LANG=C
export PATH
export LANG
mysqldump -u root -pxxxx xxxx >/root/mysqlbackup/xxxx.sql
tar -zcvf /root/mysqlbackup.tar.gz /root/mysqlbackup/ >>/tmp/xxxx.log 2>&1
/root/Dropbox-Uploader/
dropbox_uploader.sh upload /root/mysqlbackup.tar.gz >>/tmp/xxxx.log 2>&1
rm -rf /root/mysqlbackup.tar.gz
crontab中类似这样:
0 1 * * 1 root sh /root/
backup.sh如果不修改Dropbox-Uploader原脚本,它在crontab运行下会永远提示是第一次运行 Dropbox-Uploader 的状态,也就是交互输入appid的那种情况。