Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Add, edit and delete cron jobs in cPanel

This guide shows how to make your server run a task on its own at set times.

cPanel2 min read13 steps

What is a cron job?

A cron job is an alarm clock for the server. At the time you pick, it runs a command or a script. Examples are making a backup each night, clearing old files, or running a WordPress task. cPanel is the dashboard of your hosting account. It has a page called Cron Jobs where you set these alarms.

How the time fields work

A schedule has five parts, in this order.

FieldAllowed values
Minute0 to 59
Hour0 to 23
Day1 to 31
Month1 to 12
Weekday0 to 6 (0 is Sunday)

A star (*) means "every". So 30 2 * * * means 2:30 in the morning, every day.

Add a cron job

  1. Log in to cPanel.
  2. Under Advanced, click Cron Jobs.
  3. Optional: type your email address under Cron Email and click Update Email. You then get a message each time a job runs.
  4. Under Add New Cron Job, pick a time from Common Settings, or type your own values in the five boxes.
  5. In the Command box, type what should run. Example for a PHP script:
    /usr/local/bin/php /home/username/public_html/script.php
    This runs the PHP file. Replace username and the file name with your own. The PHP path may differ. Ask support if it does not work.
  6. Click Add New Cron Job.

Edit a cron job

  1. Scroll to Current Cron Jobs.
  2. Click Edit next to the job.
  3. Change the time or the command.
  4. Click Edit Line to save.

Delete a cron job

  1. Scroll to Current Cron Jobs.
  2. Click Delete next to the job.
  3. Click Delete Line to confirm.
Warning: A wrong command can delete files or overload the server. Test a command by hand first, and avoid running jobs every minute unless you really need to.

If your job does not run

  • Check the schedule for typos.
  • Use full paths, not short ones.
  • Read the email output for error messages.
  • Make sure the script file has permission to run.

Quick recap

  • A cron job runs a task on a schedule.
  • Open Cron Jobs in cPanel to add, edit or delete one.
  • Five fields set the time: minute, hour, day, month and weekday.
  • Use full file paths and test your command first.