Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#305571 - 30/12/2007 16:12 cron.daily never runs
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
I've got a problem with my web/email server. None of my cron.daily/weekly/etc. jobs run. This means that my logs don't get rotated, and (more importantly) none of my backups run.

I've tried searching, but my google-fu is weak on this topic.

It's a Debian GNU/Linux 4.0 box, with no relevant (I think) modifications to /etc. /usr/sbin/cron is definitely running. It just doesn't seem to do anything.

As an aside, it's a VPS, which means it's sometimes a bit short of memory, but I don't think that this is the problem.

In /etc/crontab, the lines look like this:

 Code:
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )


Since I do have /usr/sbin/anacron, and it is executable, it seems to me that the line won't do anything. However, if I start anacron with /etc/init.d/anacron start, it doesn't stay running.

What's supposed to be happening here? How are cron and anacron supposed to interact?

Do any of the other Linux people here have any suggestions for troubleshooting steps? I'm out of ideas.
_________________________
-- roger

Top
#305579 - 30/12/2007 17:16 Re: cron.daily never runs [Re: Roger]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4174
Loc: Cambridge, England
imfeelinglucky://anacron

Anacron isn't a daemon: when run, it runs any anacron-jobs whose start-times fell in the period since anacron last run. For machines which are switched on and off each day, and aren't usually up at midnight, this is what you want; for a server, or anything usually up 24/7, it isn't.

I'm not sure where anacron keeps its own list of anacron-jobs (it's not the same as cron's list of cron-jobs), but it looks as if the Debian folk set things up so that anacron-jobs are used for all the system tasks if anacron is installed (it probably runs during, or just after, system startup) -- and a parallel collection of plain cron-jobs do the work if anacron isn't installed.

Unless you explicitly use anacron for something, it sounds like this box just needs anacron de-installing.

Peter

Top
#305580 - 30/12/2007 19:01 Re: cron.daily never runs [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5682
Loc: London, UK
 Originally Posted By: peter
Unless you explicitly use anacron for something, it sounds like this box just needs anacron de-installing.


Oh, OK. I thought that they'd play nice together. I didn't realise that I would have to reboot the machine once a day. I wonder how anacron managed to get installed in the first place.

Anyway, I've removed it. I guess we'll see if the jobs run tonight.
_________________________
-- roger

Top
#305583 - 30/12/2007 19:17 Re: cron.daily never runs [Re: Roger]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14486
Loc: Canada
The crontab on my debian 24/7 server (23 watts idle state) looks like this:

25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly

There is no /usr/sbin/anacron executable, and cron seems to work just fine.

Cheers

Top