I had a cron job run every week and it worked fine for a year or so. I noticed recently that it stopped working and I don’t know why. I have looked at the crontab through shell and everything looks fine. I also looked at the .sh file and it looks fine too.
I will post the crontab and .sh file, but will change the words/exact paths for security reasons.
0 2 * * 6 /home/hidden/backups/mysql.sh
This should run every Saturday at 2:00 am and backup my single MYSQL database.
mysqldump --opt -uhidden -phidden -h localhost.hidden > mysql/hidden.$suffix.sql
tar -cf archives/mysql_backup.$suffix.tar mysql/*
rm -r mysql/
Note: if I run the ./mysql.sh manually it works fine and make a backup of the database. I also do not receive an email showing any errors.
If anyone can help me out with the problem that would be great.