[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron ignores one task



  Josep> I've got two tasks (shell scripts) programed under cron
  Josep> to be executed periodically as root. The first one is
  Josep> executed right but the second one is ignored.
  Josep> 
  Josep> What is happening?

  Sven> Do you have a blank line at the end?
  Sven> You need one otherwise cron ignores the last job.

  Bill> I don't have a blank line at the end of *my* crontab.  And it
  Bill> works fine....

  Sven> man crontab
  Sven>
  Sven> BUGS
  Sven>        Although cron requires that each entry in a
  Sven>        crontab end in a newline character, the neither
  Sven>        the crontab command nor the cron daemon will
  Sven>        detect this error. Instead, the crontab will
  Sven>        appear load normally. However, the command will
  Sven>        never run. The best choice is to ensure that your
  Sven>        crontab has a blank line at the end.
  Sven>
  Sven> Are you sure? Do you use an alternativ cron
  Sven> implementation without this "bug"?

Not intentionally... :-)

% dpkg --list | grep -i cron
 ii  cron        3.0pl1-72    management of regular background processing

And I'm certain that my last crontab entry is being run...

However, I use emacs for editing my crontab and have emacs set to
always include a newline on the last line so I wouldn't see the
aforementioned "feature".

Boy, you learn something every day.

Personally, I wouldn't put in the blank line - just be sure to
include the newline.  But that's me.

Thanks for the clarification.

Josep?

- Bill
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Bill Benedetto     <bbenedetto@goodyear.com>    The Goodyear Tire & Rubber Co.
I don't speak for Goodyear and they don't speak for me.  We're both happy.



Reply to: