Wednesday, November 2, 2011

Note to self - remember how run-parts work

A couple weeks ago I wrote a bash script and tested it and the script worked. I copied the bash script to the daily cron jobs (/etc/cron.daily) and after a couple of days I noted that it had never been run. After 2 hours of debuging I syill could not get it to run. However, then I rembered that the cron jobs are executed by run-parts. I opened the man page and what did I find:

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

The filename of my bash script had a dot in it ( and crontab does not use run-parts with the --lsbsysinit option nor the --regex option. This is the second time I have screwed up a cron script name like this.

The simple solution was to remove the suffix from the filename of the script.

No comments:

Post a Comment