Cron Jobs – An Excellent Utility For UNIX
Before moving further into the article I would like to give a fleeting introduction about Cron. Well, Cron is derived from the information chronograph that method a time piece. It is a time based job scheduler that helps a user to schedule commands and shell scripts to execute automatically at a specific time or date. It is a system service which is used for calling a particular URL regularly.
Cron is basically an important utility in UNIX, Linux or Solaris that allows responsibilities to be executed automatically in the background at usual intervals by the daemon. These responsibilities are referred as Cron jobs in UNIX.
Cron performs very useful function of scheduling. It is just like a task scheduler in Windows. It is responsible for scanning the file Crontab every minute. It checks whether the stated time and date information matches the current time and date. If the current time and the stated time are equal then it will execute the specific command line.
It is basically a program that facilitates UNIX users to run commands automatically at a stated time and date. It is very useful for sending messages, generating invoices, providing backup files, database and clearing permanent files. Nowadays, it is commonly used to connect to the internet and for downloading emails. It usually stores its entries in the crontab or cron table file.
Command for cron job
Listed below is a crontab command that will activate the desired responsibilities automatically on the hour:
0 * * * * wget -O – -q -t 1
In the above command * * * * represent when the task should happen. The first figure represents minute and * is a wildcard which method “every time.”
How to set up cron job
Cron is a daemon. You have to start it once and thereafter it will lay idle until it is required. It usually stores its entries in the crontab. These jobs are usually scheduled by setting up crontabs. crontab is a text file that contains the commands to be run. A file is produced and edited by command line interface. If you have to edit a crontab by command line then you have to kind crontab -e.
crontab is a text file that contains the commands that have to be executed. It has five fields for specifying day, date and time followed by the command to be run at that interval.
I hope now you have a good idea of cron jobs.