4
I'm setting up my Debian server to backup my databases with crontab, the mysqldump utility and gunzip.
For some reason, my crontab lines appear to fail, especially the crucial one:
15 2 * * * /usr/bin/mysqldump --user=root --password=XXX --all-databases | /bin/gzip > /backup/database_`date '+%d-%m-%Y'`.sql.gz
I've read several sujects about the possible origins of this behavior, but still I fail to see the reason why this crontab job still fails to create the file after I:
- Used the root privileges: I use
sudo crontab -e
to edit the root crontab. - Used a whereis to find the complete paths of the commands I'm using, replacing for instance
mysqldump
with/usr/bin/mysqldump
. - Checked that the whole line works under root: it does create an archive with today's date, filled with the mysqldump result (showing a warning because I'm using a password in the CLI, but I don't think that'd cause any problem with crontab, right?)
I suppose something is wrong in the way I configure this line in the crontab, but I cannot see it.
Apparently, the crontab is working properly because when I append the line * * * * * env > /backup/env.txt
I do get a file that contains the env content in the /backup folder...
Would someone have a clue about this?
Thank you !
~Stéphane