Cron jobs run scripts on a schedule — useful for backups, data imports, WordPress tasks, or any recurring automation.
Creating a Cron Job
- Log in to the Webfort control panel and go to Websites.
- Select the website the job should run on.
- Click Scheduled Tasks (or Cron Jobs) in the top navigation.
- Click Add Scheduled Task.
- Enter the command to run — for example
php /home/user/site/script.phporcurl -s https://yourdomain.com/cron.php. - Set the schedule using the dropdowns or a cron expression (see below).
- Click Add.
Cron Expression Basics
A cron expression has five fields: minute, hour, day of month, month, day of week.
0 * * * *— every hour, on the hour*/15 * * * *— every 15 minutes0 2 * * *— every day at 2am0 0 * * 0— every Sunday at midnight
WordPress Cron Example
To replace WordPress's built-in cron with a real one, disable WP-Cron in wp-config.php:
define('DISABLE_WP_CRON', true);
Then add a cron job that runs every 15 minutes:
curl -s https://yourdomain.com/wp-cron.php
Best Practices
- Don't schedule jobs more often than they need to run — every minute is rarely necessary.
- Redirect output to a log file (e.g.
>> /home/user/cron.log 2>&1) to help debug failures. - Test the command in a terminal or via SSH before scheduling it.