Browse
 
Tools Add
Rss Categories
-->

Set up a Cron Job (Unskinned)

Reference Number: AA-00885 Created: 2012-09-20 13:23 Last Updated: 2012-10-08 13:16 0 Rating/ Voters

How to set up a cron job in cPanel for VPS (Unskinned)

Click here for a video tutorial

How to set up a cron job.

This demo assumes you've already logged in to cPanel.

Now let's learn how to set up a cron job.

1) Scroll down.

2) Click the Cron jobs icon.

Image:Cron.JPG

There are two ways to set up a cron job in cPanel: an easy way and a hard way. Let's choose the easy way.

3) Click the Standard button.

Image:Stan.JPG

Every time a cron job runs, the output (results) of the cron are sent to an email address.

4) Enter the email address where you want the cron results sent.

Image:Enter.JPG

5) Now you have to enter the command of the script you want to run, including the path (from root).

In this case, we're going to run a script called clients.cgi, which is located in the cgi-bin directory of this account. (The username for this account is abc123c.)

6) Enter the command in the "Command to run" box.

Image:Comm.JPG

Now we have to specify the timing of this cron, i.e. when and how often we want the script to run.

In this case, we want the clients.cgi script to run at 12:00 a.m. (midnight) on the first Sunday of each month.

Minutes: Select 0 for the exact minute the cron is to run (on the hour).

Image:Min.JPG

Hours: Select 0 = midnight for the exact hour the cron is to run.

Image:Hrs.JPG

Days: Select 1 to have the cron run on the first day of the month.

Image:Day.JPG

Months: Select Every Month so the cron runs every month.

Image:Mon.JPG

Weekdays: Select Sunday so the cron runs every Sunday.

Image:Sun.JPG

7) Now click the Save Crontab button.

Image:Savcr.JPG

That's it! The cron job has been set, and will now run every Sunday at midnight.

8) Click the Go Back link.

Image:Clickgoback.JPG

9) Click the Standard button.

Image:Stan.JPG

You can return to this screen if you ever want to edit or delete an existing cron job. Or you can set up additional cron jobs in the Entry 2 section.

10) Let's delete the cron job we just created. Click the delete button for Entry 1.

Image:Entry.JPG

The cron job has been deleted.

11) Click the Go Back link.

Image:Clickgoback.JPG

Let's take a quick look at the advanced method of creating a cron job.

12) Click the Advanced (Unix Style) button.

Image:Unix.JPG

This method of creating cron jobs is not as straight-forward, and should only be used if you know exactly what you're doing.

Image:Adv.JPG

This is the end of the tutorial. You can now create as many cron jobs as you wish. But please be mindful that cron jobs have the potential to take up a lot of server resources.

Rss Comments
  • There are no comments for this article.
Info Add Comment
Nickname: Your Email: Subject: Comment:
Enter the code below: