OS_操作系统的CRONTAB 无法定时自动执行
2016-01-04 21:25
309 查看
前两日,客户要求我进行数据同步,我写好了脚本,设置了定时执行,让其在晚上后台自动执行,谁知第二天竟然没有执行。不得已又手动开始执行,
该问题已经遇到过多次,为了彻底解决该问题,今日对该现象进行了分析。
1.查看cron执行日志
查询 /var/adm/cron/log 报错如下:
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
问题原因:
crontab 没有定时执行是因为“! cron: 0481-087 The c queue maximum run limit has been reached.”。
修改/var/adm/cron/queuedefs 文件。在里面加上这样一句:"c.200j20n60w",然后kill PID,其中PID为cron进程号,新的cron设置就会生效。
Maximum number of jobs in the queue by default was 50. The errorc 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 file and change
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), 50 entry batch queue
# b.50j20n60w
c.600j10n120w
在/var/adm/cron/queuedefs/queuedefs加以C队列为1000就可以了。
ps -ef|grep cron
kill -9 con服务的进程号
cron的服务会自动重启,问题解决。
清理cron log文件(400M).
该问题已经遇到过多次,为了彻底解决该问题,今日对该现象进行了分析。
1.查看cron执行日志
查询 /var/adm/cron/log 报错如下:
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
! cron: 0481-087 The c queue maximum run limit has been reached.
Mon Jan 4 14:35:00 BEIST 2016
! 0481-095 The cron job is being rescheduled.
Mon Jan 4 14:35:00 BEIST 2016
问题原因:
crontab 没有定时执行是因为“! cron: 0481-087 The c queue maximum run limit has been reached.”。
修改/var/adm/cron/queuedefs 文件。在里面加上这样一句:"c.200j20n60w",然后kill PID,其中PID为cron进程号,新的cron设置就会生效。
Maximum number of jobs in the queue by default was 50. The errorc 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 file and change
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), 50 entry batch queue
# b.50j20n60w
c.600j10n120w
在/var/adm/cron/queuedefs/queuedefs加以C队列为1000就可以了。
ps -ef|grep cron
kill -9 con服务的进程号
cron的服务会自动重启,问题解决。
清理cron log文件(400M).
相关文章推荐
- Unity内存申请和释放 科学分析
- 【剑指offer】4.2画图让抽象问题形象化——面试题20:顺时针打印矩阵
- Caffe傻瓜系列(9):训练和测试自己的图片
- PS CC 2014 把一个图层输出为文件的方法
- VC 6.0错误类型
- html5图片懒加载
- git的学习和使用
- 在caffe上做FCN模型fine-tune的一些注意事项
- 5-11 分段计算居民水费
- 【剑指offer】4.2画图让抽象问题形象化——面试题19:二叉树的镜像
- 串口摄像头得到了一张图像的JPEG数据,我把这些数据复制到txt文档了,想将这些数据变为图像
- 【剑指offer】3.4代码的鲁棒性——面试题18:树的子结构
- chapte13:学习shell scripts之(1)简单的shell scripts
- Socket模型(二):完成端口(IOCP)
- 读取xml文件和json文件
- unity音效插件—— FMOD学习
- matlab2013b 安装教程
- 大话设计模式
- Java学习之Iterator(迭代器)的一般用法 (转)
- 华为机试练习题汇总