How to Set Up Cron Jobs Print

  • 0

Cron jobs run scripts on a schedule — useful for backups, data imports, WordPress tasks, or any recurring automation.

Creating a Cron Job

  1. Log in to the Webfort control panel and go to Websites.
  2. Select the website the job should run on.
  3. Click Scheduled Tasks (or Cron Jobs) in the top navigation.
  4. Click Add Scheduled Task.
  5. Enter the command to run — for example php /home/user/site/script.php or curl -s https://yourdomain.com/cron.php.
  6. Set the schedule using the dropdowns or a cron expression (see below).
  7. 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 minutes
  • 0 2 * * * — every day at 2am
  • 0 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.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution