Skip to content
SPECIAL DEAL: GET 10% OFF ANNUALLY OR 20% OFF BIENNIALLY!! Merry Christmas and a happy New Year from everyone at NuHosting

Setting Up A Cron Job

A cron job runs a command or script on a schedule, for example a nightly task for your website.

  1. In cPanel, open Advanced → Cron Jobs.
  2. Choose a schedule from Common Settings, or set the minute, hour, day, month and weekday yourself.
  3. Enter the command, for example:
    /usr/local/bin/php /home/username/public_html/cron.php
  4. Click Add New Cron Job.

Use the full path to PHP and to your script. To stop cron emails, add >/dev/null 2>&1 to the end of the command.

Only run jobs as often as you need to: very frequent jobs use your account’s resources.

Leave a comment

Your email address will not be published. Required fields are marked *