Home / Guides / Your site

3 min read ยท Updated

Set up a cron job

A cron job runs a command on a schedule, like clearing a cache every night or sending a daily email digest.

Open the cron editor

In cPanel, open Cron Jobs. At the top you can set an email address to receive the output of every cron run. Leave it blank if you don't want notifications.

Add a cron job

  1. Under Add New Cron Job, pick a schedule from the Common Settings dropdown, or fill in the five time fields yourself (minute, hour, day, month, weekday).
  2. In the Command field, type the full path to your script. For a PHP script:
    /usr/local/bin/php /home/username/public_html/cron.php
  3. Click Add New Cron Job.

Common schedules

ScheduleCron expression
Every 15 minutes*/15 * * * *
Once per hour0 * * * *
Once per day (midnight)0 0 * * *
Once per week (Sunday)0 0 * * 0

Silence the output

If you don't need email notifications for a specific job, add >/dev/null 2>&1 to the end of the command.

Edit or delete

Your existing cron jobs are listed at the bottom of the same page. Click Edit to change the schedule or command, or Delete to remove one.

← All guides

Stuck on a step? Email support@dredgehost.com and we'll help you sort it out.

Did this guide help? A short review on Trustpilot helps other people find a small host they can trust.