Scheduled tasks (cron)
Some sites need to run an operation at regular intervals: send newsletters, clear the cache, update data, back up the database. These operations are called cron jobs.
Open Cron from the menu: one page lists every job of your sites (the administrator sees them all), with the schedule in words (“every day at 03:00”), the next run and the outcome of the last one. The same jobs also appear in the Overview tab of each site.
Adding a job
- Press New job and choose the site.
- Choose when: every few minutes, hourly, daily, weekly (with the days), monthly, or Custom to write a cron expression. On the right you see the schedule in words and the next five runs.
- Write the command (ready examples: PHP script, calling a URL, Laravel scheduler).
- Optionally add a note, change the time limit (one hour by default: longer runs are stopped) and turn on Email me if it fails.
- Press Create job.
The command runs as the site user, so it can only touch that site's files. Times are in the server time zone, shown at the top of the page.
Last run and output
For every job you see whether the last run succeeded or ended with an error (with its code), when it happened and how long it took, plus the last lines of the output. Click the outcome to read the whole output. The output is kept in logs/cron/ in the site home (the last run and the previous one).
Run now, pause, edit
- Run now (▷) starts the job right away as the site user and shows its output.
- The switch on the left pauses a job without deleting it.
- The pencil changes schedule, command, time limit and alerts; the bin deletes the job.
Email alerts
With Email me if it fails the panel writes to the site's account (and its reseller) when a run ends with an error or exceeds its time limit: at most one email a day per job, with the last lines of the output. System emails must be configured by the administrator.
WordPress
If a WordPress site uses “WP-Cron on the system cron”, the job appears as WordPress (managed by the panel): you see it with its last run, but it is changed from the WordPress section.
Cron expressions
A cron expression has five fields: minute, hour, day of month, month, day of week. For example 30 2 * * * means “every day at 2:30”, */15 8-18 * * 1-5 “every 15 minutes from 8 to 18, Monday to Friday”. The shortcuts @hourly, @daily, @weekly, @monthly and @reboot (at server start) are accepted too.