你的位置:
问答吧
-> Shell
-> 问题详情
为什么mysql自动备份出来都是0KB?
小弟做了个备份shell,但用crond定时执行的时候备份出来都是0 kb,可手动运行shell备份出来就是好的,请高手解答!
备份shell :
DATE=`date +%Y-%m-%d-%H`
cd /usr/local/bin
mysqldump -uroot -ppassword database1 > /backup/database1$DATE.sql
mysqldump -uroot -ppassword database2 > /backup/database2$DATE.sql
crondtab:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
00 4 * * * root sh /root/backup.sh
作者: gwl48
发布时间: 2007-07-09
顶啊~~~高手来啊
作者: gwl48