AIX的crontab不执行.有一台P570,AIX5.3 的crontab非常的怪:
需要每周重启一次机器,要不然所有用户的cron 任务就根本不执行.
(用户的环境变量没有问题,若reboot后,不做任何修改配置,系统会自动去执行cron,但3-5天后,系统又莫明其妙的不执行cron了,reboot后,系统又恢复正常)
查看/var/adm/cron/log 文件,里面报错信息如下:
# tail log
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
prw------- 1 root cron 0 Mar 02 09:06 FIFO
-rw-r----- 1 bin cron 4 Jun 21 2004at.deny
-rw-r----- 1 bin cron 3 Jun 21 2004cron.deny
-rw-rw-r-- 1 bin bin 94652447 Mar 02 09:25 log
-rw-r--r-- 1 root sys 1317 Jun 17 2004queuedefs
# df -g
Filesystem GBblocks Free %Used Iused %Iused Mounted on
/dev/hd9var 1.12 0.33 71% 350 1% /var
/dev/hd3 3.88 3.79 3% 569 1% /tmp
/dev/hd1 27.88 12.14 57% 24825 1% /home
/proc - - - - -/proc
/dev/hd10opt 0.12 0.08 38% 819 5% /opt
/dev/fslv00 128.62 31.44 76% 12248 1% /backup
会不会是因为/var 的空间不够了?
crontab 没有定时执行是因为“!cron: 0481-087 The c queue maximum run limit has been reached.”。
the b to c and the 50 to 200. by including this entry"c.200j20n60w"in the file. After making the changes to the file, killcron and it will respawn again with the new settings.
# here is an example of a low prority (nice 20) , 5 0 entry batc h queue
# b.50j20n60w
c.1000j2n60w
# cron values for each queue of batch jobs:
#
# queue.xxjxxnxxw
#
# queues:
#a - sh jobs d - sync event
#b - batch jobs e - ksh jobs
#c - cron event f - csh jobs
#
#xxj - maximum number of jobs in this queue (deafult 100)
#xxn - nice value at which these jobs will run at (default 2)
#xxw - wait time till next execution attempt (default 60 seconds)
#
#
# here is an example of a low prority (nice 20), 50 entry batch queue
# b.50j20n60w
需要每周重启一次机器,要不然所有用户的cron 任务就根本不执行.
(用户的环境变量没有问题,若reboot后,不做任何修改配置,系统会自动去执行cron,但3-5天后,系统又莫明其妙的不执行cron了,reboot后,系统又恢复正常)
查看/var/adm/cron/log 文件,里面报错信息如下:
# tail log
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
! cron: 0481-087 The c queue maximum run limit has been reached.
Fri Mar2 09:22:00 BEIST 2007
! 0481-095 The cron job is being rescheduled.
Fri Mar2 09:22:00 BEIST 2007
# ls -l
total 184992prw------- 1 root cron 0 Mar 02 09:06 FIFO
-rw-r----- 1 bin cron 4 Jun 21 2004at.deny
-rw-r----- 1 bin cron 3 Jun 21 2004cron.deny
-rw-rw-r-- 1 bin bin 94652447 Mar 02 09:25 log
-rw-r--r-- 1 root sys 1317 Jun 17 2004queuedefs
# df -g
Filesystem GBblocks Free %Used Iused %Iused Mounted on
/dev/hd4 4.00 1.42 65% 8940 3% /
/dev/hd2 3.00 2.01 34% 21787 5% /usr/dev/hd9var 1.12 0.33 71% 350 1% /var
/dev/hd3 3.88 3.79 3% 569 1% /tmp
/dev/hd1 27.88 12.14 57% 24825 1% /home
/proc - - - - -/proc
/dev/hd10opt 0.12 0.08 38% 819 5% /opt
/dev/fslv00 128.62 31.44 76% 12248 1% /backup
会不会是因为/var 的空间不够了?
crontab 没有定时执行是因为“!cron: 0481-087 The c queue maximum run limit has been reached.”。
修改/var/adm/cron/queuedefs 文件。
在里面加上这样一句:"c.200j20n60w",然后killPID,其中PID为cron进程号,新的cron设置就会生效。
Maximum number of jobs in the queue by default was 50. The error messages 0481-087, 0481-095 usually appears when this max number
is reached. So you can increase the maximum number of jobs in /var/adm/cron/queuedefs , vi the queuedefs fileand changethe b to c and the 50 to 200. by including this entry"c.200j20n60w"in the file. After making the changes to the file, killcron and it will respawn again with the new settings.
# here is an example of a low prority (nice 20) , 5 0 entry batc h queue
# b.50j20n60w
c.1000j2n60w
在queuedefs加以C队列为1000就可以了.
c.1000j2n60w 这什么含义? 特别是j2n60w直接看queuedefs文件,里面讲得很清楚了# cron values for each queue of batch jobs:
#
# queue.xxjxxnxxw
#
# queues:
#a - sh jobs d - sync event
#b - batch jobs e - ksh jobs
#c - cron event f - csh jobs
#
#xxj - maximum number of jobs in this queue (deafult 100)
#xxn - nice value at which these jobs will run at (default 2)
#xxw - wait time till next execution attempt (default 60 seconds)
#
#
# here is an example of a low prority (nice 20), 50 entry batch queue
# b.50j20n60w