AIX crontab调用不了脚本问题

某年,crontab -e 调用一个脚本,但是调用不起来,AIX 6.1

tail -f /etc/adm/cron/log 看到其他一些系统脚本调用起来了,但是调用日期可date日期不一致


在http://www.aixchina.net/club/viewthread.php?tid=32319&page=1找到如下解释:

看來應該是 cron daemon 和 Time zone 間的問題.
剛 man cron , 其中有說到 TZ 的問題 , 如下 :
================================================================
When the TZ environment variable is changed, either with the chtz command, a Web-based System Manager application, or through SMIT, the cron daemon must be restarted. This enables the cron daemon to use the correct time zone and summer time change information for the new TZ environment variable.
Notes:
1 If you have a job scheduled to run between 1:00 AM and 2:00 AM on the day your time zone changes from daylight saving time to standard time your job will run twice.
2 If you have a job scheduled to run between 2:01 AM and 2:59 AM on the day your time zone changes from standard time to day light savings time your job will not run. You can change the time these jobs run, run them manually, or with until the following day to run them. The cron daemon does not need to be stopped. However, if changes are made to the TZ environment variable, kill the current cron daemon so that it automatically respawns and recognizes the new TZ setting.
================================================================
建議重新進行一次 TimeZone 設定程序後, 再直接Kill cron daemon , cron daemon 會自動respawns.


然后我ps -ef|grep cron 然后kill pid ,然后cron会自动重启,然后就好了!




  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
AIX crontab执行的原因可能是由于cron队列中的运行限制已经达到最大值。这个问题通常会在/var/adm/cron/queuedefs文件中出现错误消息"! cron: 0481-087 The c queue maximum run limit has been reached."。为了解决这个问题,您可以按照以下步骤进行操作: 1. 使用vi编辑器打开/var/adm/cron/queuedefs文件。 2. 在文件中添加一行"c.200j20n60w"来增加队列中的最大作业数。这将将默认的最大作业数从50增加到200。 3. 保存并关闭文件。 4. 使用kill命令杀死cron进程,以便新的cron设置生效。 5. cron进程将会重新启动,并应用新的设置。 请注意,您需要替换命令中的PID为实际的cron进程号。 请注意,如果在执行crontab时出现错误消息"! cron: 0481-087 The c queue maximum run limit has been reached.",这意味着cron队列中的最大运行限制已经达到。您可以通过修改/var/adm/cron/queuedefs文件来增加队列中的最大作业数。在文件中,您可以使用vi编辑器将"b"更改为"c",并将"50"更改为"200"。添加一行"c.200j20n60w"。修改完成后,使用kill命令杀死cron进程,并在重新启动时生效。 另外,您还可以参考一个来自博客的例子,以设置一个低优先级的批处理队列。这个例子中使用了"b.50j20n60w"的设置,其中"b"表示低优先级,"50"表示最大作业数,"20"表示nice值,"60"表示作业间隔,并且"w"表示每周运行。 请注意,这些步骤和例子都是为了解决AIX crontab执行问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值