Setting up a Cron job

If you have a site that is hosted on a server you might have experienced that there are certain types of commands or say scripts which have to be used/entered many times so that the program you want to run will run and work effectively.

As it is very important for these types of programs that you enter the commands or these programs will not work. There are some of the programs which require the same scripting every minute, hourly, daily, weekly or monthly so that they continue working. But, these scripts are not so short and easy to be entered every minute, hourly, daily, weekly or monthly and even if it is, it is not possible for anyone to do this task for 24×7×365 days a year.

For this, it is very important to have a system for this task so that the scripts which have to be entered in different time intervals are entered and the programs will run effectively.Cron job is a kind of software which is able to do this work for you. Cron job allows you to setup a schedule of the scripts and commands to be entered on your server so that you can run the desired task on the server at the appropriate time. For example, if you want your server to accept the emails only for a limited time then you can do this by entering the required commands only once and setup the cron job.

Once it is setup it will work according and your VPS hosting server will accept the emails only for the time you have specified. This means it is a kind of a software that will run a service on your server at the time you want it to be available. The cron job can be setup with the help of the following steps:-

There are two options by which you can setup the cron job one is the standard GUI and the other is the Advanced (Unix Style) option:-

IMPORTANT :- It is important that you understand how the cron jobs actually work.You need to have a good knowledge of Linux commands before you can use cron jobs effectively, especially when using the “Advanced (Unix Style).” Check your script with your hosting administrator before adding a cron job.
Using the standard GUI:-

Steps for using the standard GUI…

1) Click on the Standard button.

2) Enter the email address in the text box provided where you want the output of your cron job files to be sent as it is requested by the first option.

3) “Entry 1” will be available to you by default. “Command to run” is the first option. Enter the command or path to a script/file you want to run in the text box.

4) After the option “Command to run” there are five options for setting the time and frequency your cron job will run:

1. Minute(s)
2. Hours(s)
3. Days(s)
4. Month(s)
5. Weekday(s)

Select from each of the categories accordingly.

5) Now, click on the Save Crontab to create the cron job entry or if you wish to reset the modifications you have made back to the default settings, click on the Reset Changes button.

6) A confirmation page will be shown stating “Cron Updated!” Click on the Go Back button to return to the main Cron Job screen.

Using the Advanced (Unix Style) Option:-

Steps for using the Advanced (Unix Style) Option…

1) Click on the Advanced (Unix Style) Option button.
2) Enter the email address in the text box provided where you want the output of your cron job files to be sent as it is requested by the first option.
3) Next, enter the Minute, Hour, Day, Month, Weekday and Command in the text boxes provided.
4) Now, click on the Save Crontab to create the cron job entry or if you want to reset the modifications you have made back to the default settings, click on the Reset Changes button.
5) A confirmation page will be shown stating “Cron Updated!” Click on the Go Back button to return to the main Cron Job screen.

About Author:

Neha is an expert author and loves sharing useful tips on how to choose best web design company in India, tips and techniques about SEO, SEM.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s