Thursday, December 31, 2009

CRON-SCHEDULER IN REDHAT LINUX

CRON-SCHEDULER

Features:

1. Scheduler

2. Rules (Cron entries) are based on times:
• minute (0-59)
• hour (0-23)
• day of the month (1-31)
• month (1-12)
• day of the week (Sun,Mon,Tue, etc. OR 0-7)
• command to execute (shell, perl, php, etc.)

3. Wakes up every minute in search of programs to execute

4. Reads cron entries from multiple files

5. Maintains per-user and system-wide (/etc/crontab) schedules

In /etc:
•cron.d/
•cron.deny - denies cron execution by user
•cron.monthly/ - runs jobs monthly
•cron.weekly/ - runs jobs weekly
•cron.daily/ - runs jobs daily
•cron.hourly/ - runs jobs hourly
•crontab - contains system-wide schedules

Note: '*' wildcard in a time column means to run for all values

6. Per-user Crontabs:
Stored in: /var/spool/cron

Task:

1. Create a cron entry for the user 'student1'
• su student1
• crontab -e
• create an entry, minus the name of the user

Note: 'crontab -l' - enumerates per-user cron entries

System-wide Crontab:
Stored in: /etc/crontab

Task:

1. Create a cron entry in: /etc/crontab

Note: 'crontab -l -u username' - enumerates per-user cron entries

No comments:

Post a Comment