How Do I Create a Cron Job (Scheduled Task)?

A cron job runs a command or PHP file automatically at set intervals. For example, it can take a backup every night, process an email queue every 15 minutes or run WordPress tasks.

Creating a scheduled task in Plesk

  1. Log in to your Plesk panel at https://yourdomain.com:8443 or from the service page in your client area.
  2. On the Websites & Domains page, click Scheduled Tasks.
  3. Click Add Task and choose the task type: Run a PHP script, Fetch a URL or Run a command.
  4. Enter the file path or address and choose how often it runs.Plesk Add Scheduled Task form
  5. Click OK. You can test it right away with Run Now.

How to read the time expression

The five fields are, in order: minute, hour, day of month, month and day of week.

ExpressionMeaning
*/15 * * * *Every 15 minutes
0 * * * *Every hour, on the hour
0 3 * * *Every day at 03:00
0 9 * * 1Every Monday at 09:00

Tip for WordPress

WordPress's own scheduler (wp-cron) runs on every page load and can slow the site. Add define('DISABLE_WP_CRON', true); to wp-config.php and create a task in Plesk that runs wp-cron.php every 15 minutes. Details: Tips on wp-cron.php.

Running tasks too often (such as every minute) can use up your account's resource limits.

Need help? Open a support ticket from your client area or call +90 216 348 35 03.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What Do 403, 404, 500 and 503 Errors Mean and How Do I Fix Them?

If you see an error code when opening your website, the code tells you where the problem is. You...

My Website Is Slow. What Can I Do?

Page speed affects both visitor satisfaction and your Google ranking. Slowness is usually caused...

Powered by WHMCompleteSolution