Last update on .

Summary: Cron doesn’t run files with dots or underscores in them; remove that .sh!

Did you put your file in /etc/cron.daily or /etc/cron.weekly and it doesn’t run? Does cron just skip right over your file? Check that you don’t have a period or underscore in your filename. I’m talking about the .sh or .py you always put on your scripts. Yup, take that away.

All good now? I thought so.

It seems like I learn this lesson again every couple of years. This time I’m writing it down.

Update: A little additional research says that it isn’t cron; it’s run-parts that’s causing the problem. See the comments for details.

Pingbacks

Pingbacks are closed.

Comments

  1. Dave

    Dave on #

    Wait, I run scripts from cron.daily with dots in them all the time. In fact, several packages on my system ship scripts in that directory with dots in their name, like slocate.cron for example.

  2. Richard

    Richard on #

    Wow, someone found my blog!

    Thanks for the comment, Dave. The link to your blog should provide you with a
    healthy piece of my awesome Google ranking. Yeah, you're right; it wouldn't make a difference.

    A little additional research says that it isn't cron; it's run-parts. From the man page: "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."

    Thanks for helping me to clarify the behavior.

Comments are closed.