Job Scheduling in LINUX
Cron is a time based job scheduler for Unix based OS. Most of the Linux Distributions have it installed. Job scheduling is much more simple with cron. First of all, make sure that cron is installed.
rpm -qa crontabs
If output shows something then cron is installed. Otherwise we can install it.
yum install crontabs
Suppose we have to run a copy operation (for backup purpose) everyday at 12:01pm. The scheduling starts with the following command.
crontab -e
Generally the command opens a Schedule file in VI Editor. Then write the following script in that file & save that. If you aren’t familar with VI Editor then visit http://www.cs.colostate.edu/helpdocs/vi.html
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
- ._____________ minute (0 to 59)
- | .___________ hour (0 to 23)
- | | ._________ day of month (1 to 31)
- | | | ._______ month (1 to 12) OR (jan to dec)
- | | | | ._____ day of week (0 to 6) (Sunday=0 or 7) OR
- | | | | | sun,mon,tue,wed,thu,fri,sat
- | | | | |
- * * * * * command to be executed
1 12 * * * cp /file1 /file2
The script is self descriptive as the comments of the script explains the operation. Finally
service crond restart
Customize the script to schedule your own tasks. That’s all, Enjoy!!


