Skip to main content
Cron jobs let you run scripts on a schedule: backups, cleanup tasks, sending emails, or anything else you’d normally trigger manually.

Set up a cron job

1

Open the Cron Jobs page

Log in to cPanel through your client area or at yourdomain.com/cpanel. Go to Advanced and click Cron Jobs.
2

Set the schedule

Use the dropdown menus to pick how often the job runs (e.g. every hour, once a day, once a week), or enter values manually in the minute/hour/day/month/weekday fields.
3

Enter the command

Type the full command to run your script. See the examples below for common formats.
4

Save

Click Add New Cron Job.

Common command formats

PHP scripts

/usr/local/bin/php /home/username/public_html/script.php
Replace username with your cPanel username and adjust the path to match your script’s location.

Python scripts

/usr/bin/python3 /home/username/public_html/script.py

Using curl

curl -s "https://yourdomain.com/script.php" > /dev/null 2>&1
This triggers your script through an HTTP request, which is useful when the script needs to run in a web context. The domain must be resolving correctly for this to work.

Suppress email notifications

By default, cPanel sends an email every time a cron job runs. To disable this, add >/dev/null 2>&1 at the end of the command:
/usr/local/bin/php /home/username/public_html/script.php >/dev/null 2>&1
Leave notifications enabled while testing a new cron job so you can verify it runs. Once confirmed, add the suppression to avoid filling up your mailbox.

Test before scheduling

You can verify a command works by running it over SSH before adding it as a cron job. Log in via SSH and paste the same command you plan to use. If it produces the expected output, the cron job will work.
Cron jobs run according to the server’s timezone. Check the time shown at the top of the Cron Jobs page in cPanel to see what timezone your server uses.