My cron job is executing the below mysqldump command but it produces an empty sql file. However, when I run from the command line, it works as expected.
15 6 * * * root mysqldump -uroot -pXXXXXXX mydbname | gzip > /home/dbbackup/db_`/bin/date +\%Y\%m\%d\%H\%M`.sql.gz
I'm on CentOS 5.4 and use "env EDITOR=nano crontab -e" edit my cron (then paste the above command. I'm new to Linux, so forgive me I'm totally missing something here.