mysqldump and cron

aussieron

Registered
Has anyone got a cron job using mysqldump working? I'm trying to redirect output from mysqldump to backup my databases in a shell script. The commands in the script and the script itself work fine when invoked from the shell, but when I run it as a cron job I just get zero length files where the database backups should be. I've tried lots of angles on this and have yet to get mysqldump to produce anything when run under cron.
Thanks for any advice you might have.
 
put your mysqldump code in a file with execution right and verify to execute youre cron job as an allowed mysql user.
 
The problem turned out to be the crontab setting the PATH variable so that it didn't include a path to mysqldump. I was using cronnix to manipulate the crontab and just didn't realise what else was happening at the start of the crontab. Invoking mysqldump with the full path to it got everything working as expected.
 
Back
Top