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
- Log in to cPanel.
- In the Advanced section, click Cron Jobs.
- 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.
- In Command, enter the command your app gave you.
- 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.phpcPanel 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.