centos crontab 没有立即生效原因

来源:互联网 发布:c语言 判断字符集 编辑:程序博客网 时间:2024/04/29 22:27
第一种是脚本执行了,但是报错:在crontab里调度运行,结果发现没有结果,查看/var/log/messages 日志,发现crontab有执行,但是失败。
手动运行都是可以的,放在crontab里边发现就不能运行了。
处理方法:脚本中不要采用相对路径,全部改为绝对路径

第二种是编辑/var/spool/cron/user   user为执行用户名,一般为root
如更改后不起效果,请重新加载crond:
处理方法: /etc/init.d/crond reload 

第三种 用crontab -uuser -e  进行编辑
use the following command add entries to crontab should take effect right away.
#crontab -uuser -e

如还不行就重启服务:
处理方法:/etc/init.d/crond restart  
0 0
原创粉丝点击