Backup2Mail is mini PHP application that creates regular backups of your MySQL database and sends it to configurable e-mail address. The whole process is scheduled with a help of Cron, a Unix program that runs programs at scheduled times.
crontab -e
(to edit Cron schedule table) and the text editor should show up.0 0 * * * php /home/your_account/backup2mail/index.php >/dev/null 2>&1
Numbers and asterisks are the interval part, see the cheat sheet below.
php /home/your_account/backup2mail/index.php
means that PHP will execute the script, and >/dev/null 2>&1
tells Cron not to send output to e-mail specified in the first line of Cron configuration file.
Replace 'your_account' with your account username, and adjust the interval (the above is everyday at midnight).
* * * * * | every minute |
---|---|
0 0 * * * | every day at midnight |
0 5 * * * | every day at five o'clock in the morning (11 = 11AM, 23 = 11PM) |
0 0 * * 0 | every Sunday at midnight (0 = Sunday, 1 = Monday, ...) |
crontab -l
to check if everything is set properly. If it is, exit command line.