linux debian crontab作业未执行 [英] linux debian crontab job not executed

查看:30
本文介绍了linux debian crontab作业未执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 bash 脚本 foo.sh 位于 /etc/cron.daily 目录中,chmoded 700,由 root 拥有,root 用户的 crontab 列表是与核心 Debian 安装保持不变(crontab -l).我确实以 crontab -l 和/或 crontab -e 以外的另一种方式运行 cronjob(例如,我没有按照特定 Debian 案例中的建议使用/etc/init.d/cron 重新启动 cron 守护程序).尽管测试作业文件在类似条件下运行.该脚本经过调试,可以作为独立任务运行而不会返回错误.我还检查了日志 (/var/log/syslog),里面没有任何问题.

I have a bash script foo.sh located in the /etc/cron.daily directory, chmoded 700, owned by root, crontab list for the root user is unchanged (crontab -l) from the core Debian installation. I did run cronjob in another way than crontab -l and/or crontab -e (eg I did not restart cron daemon with /etc/init.d/cron as adviced in the specific Debian's case). Despite a test job file is running under similar conditions. The script is debugged and can be run as a standalone task without returning errors. I've also checked logs (/var/log/syslog) and nothing wrong in there.

但是:这个特定的工作根本没有被执行.

But: this particular job is not executed at all.

推荐答案

哎呀.猜猜我找到了为什么",或者至少找到了如何":

Oops. Guess I found the "why" or at least, the "how" :

只有重命名作业文件名而不使用.sh"扩展名解决了这个问题.

我认为这是 Debian 的错误,但事实并非如此,如下面的其他答案所述.

I thought it was a Debian's bug but it isn't, as described in the other answers below.

解决方案:通过删除脚本名称中的所有 .+ 字符来重命名脚本

SOLUTION: rename your script by removing all . or + characters from its name

这篇关于linux debian crontab作业未执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆