I am trying to do a mysqldump
on the cron
for every 5 minutes but it seems that it is not working. I try to execute the mysqldump
and it works fine.
mysqldump
mysqldump -uroot -ppassword --single_transaction --opt dbname | gzip > /home/myhome/backup/dbname.`date +"%T"`.sql.gz
cron
*/5 * * * * mysqldump -uroot -ppassword --single_transaction --opt dbname | gzip > /home/myhome/backup/dbname.`date +"%T"`.sql.gz
LOG
May 17 04:35:42 CentOS-63-64-minimal crontab[5605]: (root) LIST (root)
May 17 04:40:01 CentOS-63-64-minimal CROND[5626]: (root) CMD (mysqldump -uroot -ppassword --single_transaction --opt dbname | gzip > /home/myhome/backup/dbname.`date +")
UPDATE
I think I found the problem, it is in date +"%T"
, because if I replace it with date -I
it now works. However, I need to append a date & time on the filename.