Thursday, May 15, 2014

[AIX]How to configure Crontab

[AIX]How to configure Crontab Crontab configuration.

 It is easy and powerful utility of schuduling jobs.
 And crontab is using variable OS like linux, solaris and so on.

1. Contents of crontab
File Location: /var/spool/cron/crontabs/         # Restoring each file for each account
Log Location: /var/adm/cron/log

Listing current crontab configuration

# crontab -l
cron_1
2. A command for modifying crontab
# crontab -e                # It uses same editor as vi.

3. Control using crontab command
       /var/adm/cron/cron.allow : User lists allow to use it
       /var/adm/cron/cron.deny : User lists not to allow to use it
       If there isn't 'cron.allow, cron.deny'  file, only root user can use it.

4. Form of crontab contents
Minute     hour     day_of_month     month     weekday     command
ex) 30 6 * * 1,3,5 /usr/bin/calendar        # Excute calendar at every 06:30am mon, tue, fri every month
Minute: 30
hour: 6
day of month: *(every day)
month: *(every month)
weekday: 1,3,5 (Sunday through Saturday), mon, tue, fri

4. Kill the crontab daemon

Check crontab daemon 

# ps -ef|grep cron cron_2


Type the below command and check again.
 
# ps -ef |grep cron | grep -v grep | awk '{print "kill -9 "$2}' | sh -x






No comments:

Post a Comment