ADAM'S WEB PRESENCE

12 September 2006

CRON got me a beauty this week

Filed under: Nerd Notes — adam @ 12:17 pm

Why don’t I have a simpler hobby like gardening or matchbook collecting? Computers can drive me insane some days.

I have this script on my Debian server which is supposed to run every day but every morning when I check my logs, I find it has failed to run. The script works fine when I run it manually. I have put it in the /etc/cron.daily directory with the correct permissions, but CRON just ignores it - what is going on ?

I was determined to find the problem today. And I did. You see CRON uses another program called run-parts to handle the process of scanning the directory and running each file contained within. After reading up a little and doing some tests, I found that run-parts will ignore any file which has a dot in it’s name. Coming from a DOS/Windows background, naturally I had named my file adam-daily.sh because it is a shell script. Removing the “.sh” fixed the problem.

This is the price I pay for not sufficiently dedicating my life to the UNIX way.

2 Comments »

  1. Comment by Robert — 5 December 2006 @ 8:47 am

    Hey Adam,

    As a Unix sysadmin, I can say that this is a Linux problem _not_ a UNIX problem ;-)

  2. Comment by adam — 5 December 2006 @ 11:13 am

    Hey Robert, thanks for the correction. I’ve done a little SCO and a little Solaris over the years but my UNIX experience has been mostly on Linux.

RSS feed for comments on this post. TrackBack URI

Leave a comment


Powered by WordPress