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.
We need to specify two things in order to set up one of these jobs:
- The command line you want the computer to run
- When to run the command
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:
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.
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,
- 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/php(PHP 4) or
- 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
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.