How to set up a cron job

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

cPanel1 min read

Steps

  1. Open Cron Jobs

    In cPanel, go to the Advanced section and click Cron Jobs.

  2. Choose the schedule

    Under Add New Cron Job, pick a preset from Common Settings, such as Once Per Hour, or fill in the minute, hour, day, month and weekday fields.

  3. Enter the command

    In Command, enter what to run, for example /usr/local/bin/php /home/username/public_html/cron.php.

  4. Save

    Click Add New Cron Job.

Tips

  • Add an address under Cron Email to receive the output of your cron jobs, which helps with troubleshooting.
  • Avoid running jobs more often than you need. Every run uses your account’s resources.

Related guides