Hello all,
I trust you're well as you read this request for assistance. I am not very experienced in the Linux world, but all the same I'm striving to learn as quickly as possible. So please pardon any obvious ignorance on my part and assist if possible.
I am running a ClearOS v5.2 Enterprise server (based on the Centos linux distro) and I'm using the following command in a shell script to backup my MySQL database.
mysqldump -u root -pMYPASSWORD --all-databases > /mnt/shares/flexshares/backup/MySQL/mysql-backup-`date +%Y-%m-%d-%H-%M`.sql
I use a cron job to call this script @ 1:15 AM daily. Now, I can see in the cron log that the job is executed at that time and the script is called, but the command doesn't execute (log entries below). I say this because I don't see the sql file being created in the /mnt/shares/flexshares/backup/MySQL directory.
Aug 21 01:15:01 server1 crond[27842]: (root) CMD (/root/my_scripts/backup-mysql.sh)
Aug 22 01:15:01 server1 crond[9031]: (root) CMD (/root/my_scripts/backup-mysql.sh)
Strangely enough, if I run the same command from the CLI it executes without any problems and the MySQL database is dumped to the target directory (/mnt/shares/flexshares/backup/MySQL).
What am I missing or what have I included in the script that's causing it not to run? Here's my shell script ("backup-mysql.sh"):
#!/bin/bash
# FULL BACKUP OF MySQL DATABASE
mysqldump -u root -pMYPASSWORD --all-databases > /mnt/shares/flexshares/backup/MySQL/mysql-backup-`date +%Y-%m-%d-%H-%M`.sql
I am very grateful for any help I can get, thanks.
v/r
Kismet