I have the following script in /etc/cron.daily/, it works perfectly if I execute it manually but never runs via cron. There are other scripts in cron.daily that do execute however.
#!/bin/bash
DATE=`date +%Y%m%d`
FILENAME=mysql_$DATE.tar.gz
DESDIR=/data/mysqlbackup/
echo Deleting backups older than 30 days
echo Files deleted:
find /data/mysqlbackup/ -mtime +30 -type f -ls
find /data/mysqlbackup/ -mtime +30 -type f -delete
echo Backing up all databases
mysqldump -u backup -p --all-databases --events | gzip > $DESDIR$FILENAME
echo Backup complete:
ls -lh $DESDIR
What could the issue be?
I'm running Ubuntu 14.04