+254725682556 +254725052660 info@ziprof.co.ke
Client Area

cPanel - Control Panel

How to Set Up a Cron Job in cPanel

A cron job is a task that runs automatically on a schedule you set, without you needing to trigger it manually. Common uses include running a scheduled script for a web application, sending automated reports, or triggering a backup routine.

Creating a Cron Job

  1. Log in to cPanel.
  2. Under the Advanced section, click Cron Jobs.
  3. Under Add New Cron Job, choose how often the job should run using the Common Settings dropdown, or set the minute, hour, day, month, and weekday fields individually.
  4. In the Command field, enter the command to run, for example a PHP script's full path.
  5. Click Add New Cron Job.

Example Schedules

  • Once a day at midnight: minute 0, hour 0, every day, every month, every weekday.
  • Every 30 minutes: use */30 in the minute field.
  • Once a week on Monday at 6am: minute 0, hour 6, every day of month, every month, weekday set to Monday.

What the Command Should Look Like

For a PHP script, the command typically needs the full path to PHP and the full path to your script, for example:

/usr/local/bin/php /home/yourusername/public_html/script.php

If you're not sure of the correct PHP path for your account, cPanel's Cron Jobs page usually lists it, or you can ask ZIPROF support to confirm it for your server.

By default, cPanel emails you the output of every cron job run. If a script produces regular output you don't need to review, either suppress output in the command itself or set the notification email field to blank to avoid a full inbox.