Setting up cron jobs (scheduled tasks) from the control panel

Computers are good at doing repetitive work, us humans are not. So to help us with this, computers can be programmed to run things on our behalf at specific intervals (daily, every wednesday midnight, …). This sort of thing is normally referred to as “scheduled tasks” or “cron jobs” as we encounter them in a UNIX-like environment.

This feature is commonly used to schedule admin and maintenance tasks, such as regular backups, sending out email or processing orders. Our hosting control panel offers an easy way of setting up such “cron jobs” using a simple web interface.

The “Scheduled Tasks” feature can be found under the “Web Tools” heading in the hosting control panel.

We need to specify two things in order to set up one of these jobs:

  1. The command line you want the computer to run
  2. When to run the command
Scheduling a command in the control panel.

When setting up new jobs please note that the path to your script should be absolute, so if your script is called test.pl and is located in your public_html/ directory, then the full path would be:

/home/sites/example.com/public_html/test.pl

Optionally, you can set up an email address to have your cron jobs output sent to you. In the lower part of the page, just above the “Update” button (used to save your cron jobs) there is field where you can set this up.

Output can optionally be sent to a given email address .

Common problems

Please note the following common problems you may experience when setting up a scheduled task:

  • Please make sure you enter a valid date for your tasks.
  • The file permissions for the script are set correctly, 711 or 755.
  • If the scheduled program includes code from a scripting language, the path for the interpreter must be specified before the script. For example, /usr/bin/perl (Perl), /usr/bin/php (PHP 4) or /usr/bin/php5 (PHP 5)
  • If the script being run is adapted from a CGI script, ensure the first line of the script is a ‘shebang’ line containing the correct interpreter path – as above – (for example #!/usr/bin/perl).

Note

Programs that use excessive server resources may be banned. We take this opportunity to remind you that we do not allow permanent server processes to be run on our servers.