How to create a Cron job ?

To set up a cronjob you will need to press the “Create a New Cronjob” button and set a few parameters: time schedule, execution command and the email where the cronjob result notifications will be sent to.
Experience level – you can choose between Standard or Advanced level of experience – this is how you want to set up the time schedule.

1. Here is an example of cron job time scheduling:

***** command to be executed
| | | | |
| | | | |
| | | | —– day of week (1 – 7) (Monday = 1)
| | | ——- month (1 – 12)
| | ——— day of month (1 – 31)
| ———– hour (0 – 23)
————- min (0 – 59)

* * * * * -> Execute every minute
*/5 * * * * -> Execute every 5 minutes
0 * * * * -> Execute every Hour
0 */5 * * * -> Execute every 5 Hours
0 0 * * * -> Execute every day at Midnight
0 0 0 * * -> Execute every Month
0 0 0 0 * -> Execute every Weekday

2. Command to be executed

Basically, if you need to set up a cronjob for an application on your website, you will be given the exact command and the URL which you need to execute. Just in case, here are a few examples as an illustration:

– Delete files within a certain folder in your account with the following command:

rm -f * /home/www/my-best-domain.com/testfolder/

This will delete all files located in /testfolder and the “-f” stands for “force” and deletes the files without asking for permission

– Run a script, for example that will be sending emails on certain time schedule:

/usr/local/php5/bin/php /home/www/my-best-domain.com/mail.php

– Execute a file directly via web – this would be the same as opening the http://my-best-domain.com/test.php in your web browser, but using a cronjob function instead. The command in this case would be:

TERM=”xterm”; /usr/bin/lynx -dump http://my-best-domain.com/test.php