How To Set Up A Cron Job Print

  • 3

This tutorial is going to show you how to setup a cron job in cPanel the easy way. You can set a command or script to run at a specific time every day, week, etc. This tutorial will assume that you are logged into your cPanel. If you are having trouble doing that, please see the tutorial named "How to Login to cPanel".

Scroll down to the Advanced Section on the main page of your cPanel, and click on the icon named Cron Jobs. This will take you to the main Cron Job page, where it lists two different experience levels to choose from: Standard and Advanced (Unix Style). This tutorial is going to teach the Standard approach.

Click on the Standard Button. This will take you to a screen showing a Standard Cron Manager. Every time a cron job runs, the results are sent to an email address. The top line asks for the email address where you would like the cron job results sent. Enter that address into the box. Below is a box marked Entry 1. The first line is Command to Run: with a box after. In the box you need to enter the command of the script you want to run, including the path (all the way from root) For example, a command might look like this: "home/abc123/public_html/cgi-bin/clients.cgi" This command includes the entire path, all the way from the root directory.

Next, we need to specify the timing of the cron. We need to determine when and how often we want the script to run. There are boxes with different listings above them - Minute(s), Hour(s), Day(s), Month(s), Weekday(s). Using the information within each box, set the time, day, month, and day of the week you want your cron to run. When it is all set click the Save Crontab button. This will take you to a confirmation screen that will verify that your cron job has been set. Click on the Go Back link.

To return to the Standard Cron Manager at any time, click on the Standard button on the main Cron Job page. You can edit your cron, or delete it entirely by simply clicking on the delete button in the Entry box. You can also set up additional cron jobs. Return to your main cPanel page by clicking the HOME link in the upper left corner.

This is the end of the tutorial. You now know how to setup Cron Jobs the easy way, and then edit them, delete them, or add additional ones. You can add as many as you wish, but REMEMBER, Cron Jobs have the potential to take up a lot of server resources.

You can now exit cPanel by closing your browser, or by using the Logout button in the upper right corner. Remember, if you are using a public computer, ALWAYS Logout of cPanel before closing due to security reasons.


Was this answer helpful?

« Back