You are not logged in.

#1 2010-06-29 00:16:11

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

[solved][dcron] ID'd cron jobs with freq never run

I'm having an issue where dcron isn't running jobs defined as running within a range of time, with an ID, and with a frequency. In other words:

* 2-5 * * *     ID=foo   FREQ=1d       /bin/echo "foo" > /home/noclaf/cron-foo

Never runs. What I've found is that a cronstamp is being created for noclaf.foo at some arbitrary time. /var/spool/cronstamps/noclaf.foo shows the contents:

after 2010-06-29 12:16

So the job is scheduled to run no less than a day after that timestamp. But of course, that never happens because the next day at around the same time, the cronstamp is updated at some arbitrary point in the day. The 1 day elapsed, therefore, never occurs in the time slot I've given to dcron to run my job.

I recall this working on my 64 bit install before I reformatted in favor of 32 bit. The man page, crontab(1), also confirms that this sort of job description is acceptable. Have I overlooked something?

Last edited by falconindy (2010-06-30 16:26:13)

Offline

#2 2010-06-29 01:28:53

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [solved][dcron] ID'd cron jobs with freq never run

So, just to see if I understand: you want to run a job everyday between 2 and 5 am, right? Then, why do you need FREQ and ID?


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#3 2010-06-29 01:46:37

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved][dcron] ID'd cron jobs with freq never run

Because omitting the ID and FREQ, in a "classical" crontab, would mean that the job would run once a minute between the hours of 2-5.

From crontab(5):

      There's also a format available for finer-grained control of frequencies:

             # run whenever it's between 2-4 am, and at least one day (1d)
             # has elapsed since this job ran successfully
             * 2-4 * * * ID=job2 FREQ=1d date

Offline

#4 2010-06-30 15:16:43

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [solved][dcron] ID'd cron jobs with freq never run

Yes, you are right. I agree that is strange.

Is the cronstamp file rewritten everytime dcron starts (that is everytime you turn on the machine)? For instance, instead of 12:16 it should be a time between 2 and 5, right? My understanding was that cronstamps are created when the job finishes successfully.... What happens, if you manually create the correct cronstamp?


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#5 2010-06-30 16:26:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved][dcron] ID'd cron jobs with freq never run

I actually did just that (corrected the cronstamp) yesterday afternoon and the job ran...  the cronstamp now correctly reads the last time the job was run successfully.

strange... just gonna mark it solved and blame it on pebkac until it happens again.

Offline

Board footer

Powered by FluxBB