OS_操作系统的CRONTAB 无法定时自动执行
来源:互联网 发布:photoshop6 mac 编辑:程序博客网 时间:2024/06/05 00:12
前两日,客户要求我进行数据同步,我写好了脚本,设置了定时执行,让其在晚上后台自动执行,谁知第二天竟然没有执行。不得已又手动开始执行,
该问题已经遇到过多次,为了彻底解决该问题,今日对该现象进行了分析。
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).
- OS_操作系统的CRONTAB 无法定时自动执行
- 对于crontab定时任务不能自动执行的总结
- Linux crontab 自动定时执行命令学习
- crontab与bash环境变量不一致导致的无法定时执行任务~
- ubuntu定时执行任务crontab的使用
- 定时 执行脚本 的命令小结 -- crontab
- Linux的crontab命令执行定时任务
- 定时执行命令crontab的使用
- 定时执行任务crontab的使用
- ubuntu定时执行任务crontab的使用
- ubuntu定时执行任务crontab的使用
- crontab定时任务不执行的原因
- crontab定时任务不执行的原因
- ubuntu定时执行任务crontab的使用
- linux crontab设置正确,定时任务无法执行问题
- freebsd下面crontab定时任务不能自动执行原因排查
- Linux中的定时自动执行功能(at,crontab)
- Crontab定时执行工具
- java.util.ArrayList 源码
- app 2015
- C语言中static详解
- 实例7:实现仿Windows7图片预览窗格效果
- Call to undefined function curl_init()
- OS_操作系统的CRONTAB 无法定时自动执行
- 前端开发入门:包管理工具bower
- VC中的字符串
- unity音效插件—— FMOD学习
- 一个动态增长的栈实现
- Java学习之Iterator(迭代器)的一般用法 (转)
- matlab2013b 安装教程
- 读取xml文件和json文件
- 大话设计模式