How to set up a cron job

Run a script automatically on a schedule, for example every hour or every night.

Updated September 27, 20261 min read

A cron job runs a command or script on a schedule. Apps sometimes ask you to set one up, for example to send emails or clean up old data.

cPanel › Advanced › Cron Jobs

  1. Log in to cPanel.
  2. In the Advanced section, click Cron Jobs.
  3. Under Add New Cron Job, choose a schedule from Common Settings, such as Once Per Hour, or fill in the minute, hour, day, month and weekday yourself.
  4. In Command, enter the command your app gave you.
  5. Click Add New Cron Job.

A command to run a PHP script usually looks like this (replace username with your cPanel username and use your script’s path):

/usr/local/bin/php /home/username/public_html/script.php

cPanel emails the output of each run to the address under Cron Email. To stop those emails for a job, add >/dev/null 2>&1 to the end of its command.

Edit or delete a cron job

Scroll down to Current Cron Jobs and click Edit or Delete next to the job.

Don’t schedule heavy scripts to run every minute unless your app really needs it. Frequent jobs can slow your website down.

Didn’t solve your problem?

Our team is here to help, any time, day or night.