Page 1 of 1

trouble with cron

Posted: 19. May 2011, 15:10
by mimosa
If I put a file foo in /etc/cron.d

Code: Select all

*/1 * * * *   root    /usr/bin/foo >/dev/null 2>&1
@reboot       root    /usr/bin/foo >/dev/null 2>&1
it should call foo every minute and on reboot .... shouldn't it?

But in fact, the cron daemon doesn't seem to pay it any heed.

Is there something obvious I've missed :oops: , or something different about how Slackware deals with this :? ?

I tried

Code: Select all

#crontab -e
and there is no mention of cron.d. Adding it and asking for it to be checked every minute didn't work.

EDIT

However, *adding* the two lines above does seem to work. But why not in /etc/cron.d?

Re: trouble with cron

Posted: 22. May 2011, 14:40
by mimosa
I'm continuing to research this. It seems that in many (most?) distros, there is no user field when a user (including root) edits their own crontab, because the information would be redundant. In some distros (notably Debian) the same principle does *not* apply to the cron.*/* files in /etc, though it logically could because these are by their nature system files - and it seems that's how Slackware does things.

Can anyone confirm or correct these impressions?

This is a hard topic to research, because the information online overwhelmingly concentrates on the basic workings, especially the logic of the initial fields specifying the time.

Re: trouble with cron

Posted: 22. May 2011, 15:32
by pwatk
I think the problems you're having are due to the very basic (and annoying) nature of dcron. You might want to consider installing a better cron daemon if you want something more comprehensive like the other distros use e.g. bcron or Vixie cron.