Thursday, October 1, 2009

CRONTAB automate your task....

So how many of you have heard of crontab in linux.

Its something which is very useful. It automates tasks....

suppose you want to execute a task at sometime in the future (only if the system is switched on), all you need to do is add the command in the crontab.

in order to install a crontab just type crontab -e
this will open you a file to write commands with some other fields too

m h dom mon dow command

The above given is the order in which you have to make the entry in the cron..
m stands for minute of the hour
h for hour of the day(24 hour clock)
dom stands for the day of the month
mon stands for the month
dow stands for the day of the week
command this is where you specify the command which is to be executed

so as an example

34 6 9 4 * mkdir /home/username/file

the above command makes a directory named file on 9th of April at 6 hours and 34 minutes in the folder /home/username


you can also specify a range too

32-50 * 9 4 * command

the above command is executed on April 9th in every minute from 32-50 minutes in all the 24 mangagers. hours...


---the above post is incomplete, will be updated soon---

No comments:

Post a Comment