Free migrationUK web hosting from £2.99 a month, with backups every six hours and a 60-day money-back guarantee.UK web hosting from £2.99 a month.See hosting plans

How to set up a cron job in cPanel

On this page

This guide explains how to make the server run a script or command for you on a regular schedule.

Create the cron job

  1. Log in to cPanel.
  2. In the Advanced section, click Cron Jobs.
  3. Under Add New Cron Job, use the Common Settings menu to pick a schedule. This fills in the timing boxes for you.
  4. In the Command box, enter the command to run. For example, to run a PHP script: /usr/local/bin/php /home/yourusername/public_html/script.php Replace yourusername with your cPanel username.
  5. Click Add New Cron Job.

Your job appears in the list further down the page, where you can edit or delete it.

Common timings

The five timing boxes are minute, hour, day, month and weekday. A * means “every”.

ScheduleMinuteHourDayMonthWeekday
Every 15 minutes*/15****
Every hour0****
Every day at 2am02***
Every Monday at 9am09**1
First of each month001**

Times use the server clock. Avoid running jobs more often than every five minutes.

Getting the output by email

At the top of the Cron Jobs page there’s a box for an email address. Any output from your jobs is sent there. This is handy while testing.

Once everything works, you can stop the emails by adding this to the end of the command:

>/dev/null 2>&1

If it doesn’t work

  • Nothing seems to happen. Add your email address at the top of the page and remove >/dev/null 2>&1 so you can see any errors.
  • “No such file or directory”. Check the full path to the script. You can find it in File Manager.
  • The script runs with the wrong PHP version. Check your settings in how to change your PHP version.

Good to know

WordPress has its own built-in scheduler. Some plugins ask you to replace it with a real cron job for reliability. Follow the plugin’s own instructions for the exact command.

Still stuck? Open a support ticket and we’ll help.

Still stuck? Open a support ticket from your client area. Tell us your domain and which step went wrong, and we'll take it from there.
UK cPanel hosting from £2.99 a month

Every plan has cPanel, free SSL, backups every six hours and free migration.

See web hosting
Open in new tab