Knowledge base · Websites
Run a scheduled task
Add a cron job that runs as the site user, and check it with Run now.
Scheduled tasks run a command at set times, for example to send queued emails from your application each night. They are cron jobs, and each one runs as your site user from the domain’s home folder.
- Open the website and choose Scheduled Tasks.
- Under Add task enter a schedule such as
*/5 * * * *(every five minutes). - Enter the command. PHP scripts start with
php, for examplephp httpdocs/cron.php emails. - Add a description if you like, leave Enabled ticked, and choose Add scheduled task.
Check it works
Active means the job is installed. It does not prove each run succeeded. Use Run now on the task to run it straight away, then read the log.
Every run adds its output to logs/scheduled-tasks/<task-id>.log in the domain’s home folder. Open the Files tab and browse to the domain root to find it.