Well, now that we have the email script working (at least it Worked for me), let’s create a job using cron to execute it on a regular basis.
First of all, I created a new cron file under /etc/cron.d/ called dbBackup.
The file contains a simple cron expression:
0 20 * * 5 root /etc/init.d/dbBackup &
Basically, this will:
In this case, /etc/init.d/dbBackup is the script that I posted previously to make a backup of the MySql database.
I’ve just received the first scheduled email an hour ago!
For more info on cron syntax, you can visit this site.