我已将作业 ( register-dns.cron
) 添加到/etc/cron.daily/
,但它没有运行。一些测试的结果如下所示。
#↳ ls -l /etc/cron.daily/
total 28
-rwxr-xr-x 18 root root 1474 Sep 13 2017 apt-compat
-rwxr-xr-x 13 root root 355 Oct 25 2016 bsdmainutils
-rwxr-xr-x 18 root root 1597 Feb 22 2017 dpkg
-rwxr-xr-x 6 root root 4125 Feb 10 08:26 exim4-base
-rwxr-xr-x 18 root root 249 May 17 2017 passwd
-rwxr-xr-x 3 root root 66 Apr 17 11:57 register-dns.cron
#↳ (cd /; run-parts --report --verbose /etc/cron.daily)
run-parts: executing /etc/cron.daily/apt-compat
run-parts: executing /etc/cron.daily/bsdmainutils
run-parts: executing /etc/cron.daily/dpkg
run-parts: executing /etc/cron.daily/exim4-base
run-parts: executing /etc/cron.daily/passwd
#↳ (cd /; run-parts --report --verbose --reverse /etc/cron.daily)
run-parts: executing /etc/cron.daily/passwd
run-parts: executing /etc/cron.daily/exim4-base
run-parts: executing /etc/cron.daily/dpkg
run-parts: executing /etc/cron.daily/bsdmainutils
run-parts: executing /etc/cron.daily/apt-compat
我发现了问题。似乎通过
.cron
从文件名的末尾删除,它将开始工作。(文件名中不允许使用点,请参见下文)。从
man run-parts