I managed to setup a cronjob:
* 13 * * * date=`date +\%d-\%m-\%Y-\%s`; mysqldump -u root -pPassword1 db121 > /home/backup/xbackup_$date.sql; gzip /home/backup/xbackup_$date.sql
I am hoping the above will take a mysqldump everyday at 10pm and then save into the /home/backup directory. However, this has not worked for me.
Is the above entry correct in the crontab? If so, why wouldn't it take a backup as the command works fine when I execute it myself.
Thanks all for any help
Update
I was reading the centos manual for cron jobs and it says:
Users other than root can configure cron tasks by using the crontab utility.
Surley, this isn't true?
--defaults-file=/path/to/file– Wrikken Mar 31 '11 at 21:46crontab -e:)) – Alex Apr 1 '11 at 13:39