克隆在debian上的工作 – 不工作

可能是一个无聊的话题,但我昨晚整个晚上,似乎无法启动和运行。

root@host:~# /etc/init.d/cron status Checking periodic command scheduler...done (running). 

所以服务似乎运行良好。

我已经尝试了简单的testingcron作业的数量,但他们没有工作:

 * * * * * echo "Hello world !!!" 2&>1 >> /tmp/lol.log 05 06 * * mon-fri echo "Nightly Backup Successful: $(date)" >> /tmp/test.log 

以及那个,一个程序员给了我这个工作,我知道我们现在的生产服务器是完美的:

 * * * * * wget -q -O /dev/null http://www.hostname.com/test/email_au 

所以最后,他们似乎没有工作,我已经经历了networking上的一些指导,但他们似乎没有帮助。 有什么可能丢失?

编辑:唯一的cron相关的文件在等是:cron.d,cron.daily,cron.hourly,cron.monthly,cron.weekly,crontab。 那里没有cron.deny也没有cron.allow文件。 另外我正在尝试以root身份运行这些cron作业。

你有没有检查cron日志实际上发生了什么?

通常,在debian系统中禁用cron日志,在rsyslogd或syslogd中启用此function,方法是取消相应configuration文件中的cron日志行注释。

 cron.* /var/log/cron.log 

检查是否有文件/etc/cron.allow或/etc/cron.deny。 用户(但不是root用户)可以被限制运行cron作业。

从man 1 crontab:

 If the /etc/cron.allow file exists, then you must be listed (one user per line) therein in order to be allowed to use this command. If the /etc/cron.allow file does not exist but the /etc/cron.deny file does exist, then you must not be listed in the /etc/cron.deny file in order to use this command. 

你的cron文件是什么样的? 我从某些经验知道有一些Cron版本的bug,在那个cron中会忽略cron文件的最后一行(这意味着你的命令可能会被忽略,因为它可能在文件的最后一行)。 Mayhap这可能是问题?