Automating Tasks with Cron Jobs in cPanel Print

  • 0

Automating Recurring Tasks: Setting Up a Cron Job in cPanel

Cron jobs are server-side scheduling mechanisms that execute defined commands or scripts at specified intervals. This guide walks you through the process of configuring these automated tasks within your cPanel account.


Part 1: Accessing the Cron Jobs Utility

  1. Access your cPanel account by logging in with your credentials.
  2. Navigate to the Advanced section and click on the Cron Jobs utility. This is the feature that allows you to automate recurring tasks.

Part 2: Configuring the Cron Job Details

  1. Complete the necessary fields to define the schedule and command for your new cron job:
    • Common Settings - Use this pre-defined dropdown menu to quickly select common scheduling intervals (for example, Once per hour, Once per day). Selecting an option here will automatically populate the time fields below.
    • Minute - Specify the minute (0-59) within the hour the command should run.
    • Hour - Specify the hour (0-23) within the day the command should run.
    • Day - Specify the day (1-31) within the month the command should run.
    • Month - Specify the month (1-12) the command should run.
    • Weekday - Specify the day of the week (0-7, where both 0 and 7 represent Sunday) the command should run.
    • Command - Enter the exact command line instruction you wish the cron job to execute. This is typically used to run scripts.

      Example Command Structure:

      php -q /home/ACCOUNTNAME/public_html/script_in_my_root_directory.php

      (Replace ACCOUNTNAME with your actual cPanel username.)

After entering the command, click the Add New Cron Job button to save and activate your scheduled task.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution