A cron job runs a command for you on a schedule, for example a nightly backup script or a task that sends reminder emails.
Create a cron job
- Log in to cPanel and open Cron Jobs under Advanced.
- Under Cron Email, enter an address if you want to receive the output each time the job runs.
- Under Add New Cron Job, pick a schedule from Common Settings, such as "Once Per Day".
- Enter the command and click Add New Cron Job.
Command examples
Replace username with your cPanel username.
/usr/local/bin/php /home/username/public_html/script.php wget -q -O /dev/null https://yourdomain.co.zw/wp-cron.php
Timing examples
- 0 3 * * * runs every day at 03:00.
- */15 * * * * runs every 15 minutes.
- 0 8 * * 1 runs every Monday at 08:00.
Tips
- Run the command by hand first to make sure the script works.
- On shared hosting, avoid running jobs every minute. Every 15 minutes or longer is kinder to your resource limits.
- To stop the output emails, add >/dev/null 2>&1 to the end of the command.
- The server clock may not be on Harare time. Check the time shown on the Cron Jobs page before you set an hour.
Related guides
Need a hand?
WhatsApp us on +263 78 377 1089, email support@jometechafrica.com or open a support ticket. Our Harare team is available Monday to Friday, 08:00 to 17:00, and Saturday, 08:00 to 13:00.
