/etc/cron.hourly/ and run-parts

By admin

My co-worker found out the hard way what run-parts is all about.
He was trying to run an hourly cron job so he put his script file in /etc/cron.hourly/ .

The file was named something like 'launch-nuclear-attack.sh'. However,the script didn't run hourly and the nuclear holocaust never took place. He dug deep and found out that the cron.hourly files are run by a program called 'run-parts'. In the run-parts man page it says:

“names must consist entirely of upper and lower case letters, digits, under‐scores, and hyphens”

This means that 'launch-nuclear-attack.sh' was an invalid filename since it contains a period. He renamed his file to 'go_for_world_peace', and it worked fine. Also, we're all in a lot better shape to boot.



categoriaTech commentoNo Comments dataAugust 25th, 2008

About... admin

This author published 340 posts in this site.

Share

FacebookTwitterEmailWindows LiveTechnoratiDeliciousDiggStumbleponMyspaceLikedin

Leave a comment