How to set up a cron job in cPanel for VPS (Unskinned)
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.
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.
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.
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.
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).
Hours: Select 0 = midnight for the exact hour the cron is to run.
Days: Select 1 to have the cron run on the first day of the month.
Months: Select Every Month so the cron runs every month.
Weekdays: Select Sunday so the cron runs every Sunday.
7) Now click the Save Crontab button.
That's it! The cron job has been set, and will now run every Sunday at midnight.
8) Click the Go Back link.
9) Click the Standard button.
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.
The cron job has been deleted.
11) Click the Go Back link.
Let's take a quick look at the advanced method of creating a cron job.
12) Click the Advanced (Unix Style) button.
This method of creating cron jobs is not as straight-forward, and should only be used if you know exactly what you're doing.
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.