3

I have added a job (register-dns.cron) to /etc/cron.daily/, but it is not running. The result of some testing is shown below.

#↳ 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
3
  • 1
    Have you try to remove .cron? Apr 22, 2018 at 16:01
  • @RomeoNinov Yes I did, see my answer bellow. But thanks any ways. Apr 22, 2018 at 21:18
  • Not off topic. the answer is useful. Knowing that run-parts has some arbitrary rule to only allow some characters in filename, is useful. Jul 10, 2018 at 6:03

1 Answer 1

6

I found the problem. It seems that by removing the .cron from the end of the filename, it will start to work. (dots are not allowed in filename, see below ).

From man run-parts

If neither the --lsbsysinit option nor the --regex option is given then the names must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .