trouble with cron

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

trouble with cron

Post 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?
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: trouble with cron

Post 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.
User avatar
pwatk
Posts: 474
Joined: 14. Mar 2010, 23:56
Location: United Kingdom

Re: trouble with cron

Post 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.
Image
Post Reply