Webmaster Tools: setting crontabon Unix like operating systems


Cron Generator

The crontab command, is usedin Unix/Linux to schedule commands to be executed periodically.

Generally, crontab uses a daemon , crond , which runs constantly in the background and checks once a minute to see if any of the scheduled jobs need to be executed. If so, it executes them. These jobs are generally referred to as cron jobs .

Format of cron:

minute(s) hour(s) day(s) month(s) weekday(s) command(s)

There are several ways of specifying multiple values in a field:

There is also an operator with some extended versions of cron support, the slash ('/') operator, which can be used to skip a given number of values. For example, "*/3" in the hour time field is equivalent to "0,3,6,9,12,15,18,21"; "*" specifies 'every hour' but the "/3" means that only the first, fourth, seventh...and such values given by "*" are used.

Add cron using vi editor :

Step 1. at telnet prompt type: crontab -e
Step 2. [ESCAPE] i
add the cron entry by cut and pasting above
Step 3. [ESCAPE] :wq [ENTER]

This interface helps generate cron entries. Just fill out the form either using the dropdown or fill out the text area box and the script will provide you with the code and instructions on how to insert using the vi editor. Here's some basic vi syntax to assist you:

To delete a line: [ESCAPE] dd [ESCAPE]
To delete a character at cursor: [ESCAPE] x [ESCAPE]
move down a line: [ESCAPE] j [ESCAPE]
move up a line: [ESCAPE] k [ESCAPE]
exit NO saving: [ESCAPE] :q! [ESCAPE]
exit SAVING CHANGES: [ESCAPE] :wq [ESCAPE]

Minutes:
0 - 59
Hours:
0 - 23
Days:
1 - 31
Months:
1 - 12
Weekdays:
0 (Sun) - 6 (Sat)

Script/program to execute:

        

Crontab Entry: