April 23, 2009

Crontab {Automatic Task}

* The crontab is used to shedule recurring events

* Crontab files are stored in /var/spool/cron , which is not accessible by non-previleged user

* The crontab can either be edited in the current directory and installed by using it as arguement to crontab or by using the -e option

Setting the cron job

> Suppose you need to create a directory called data on 22 november at 8:20, then i will put the following enteries in the configuration file

> To run the mkdir command, you have to find its path first

# whereis mkdir

# crontab -eu vinod <-- it will open vi editor for user vinod

20 8 22 11 * /sbin/mkdir data

> save and exit

# service crond restart

# chkconfig crond on

> If you wanna remove the cronjob for user vinod

# crontab -r vinod

No comments:

Post a Comment