You are not logged in.

#1 2010-01-31 08:17:15

jcci
Member
From: China / Germany
Registered: 2007-06-10
Posts: 185

cron getting mad?

Since a cron update 2 machines with extensive daily jobs went down by end of resources. In fact they do a virusscan some cleanup and an incremental backup every day; once a week a full backup. Virusscan of course takes time, but the daily cronjob was started every 10 minutes for some reason beyond my understanding, so at last the machine was busy until exodus. Same was true for the full backup wich filled up the process list with tons of gzip accessing the same file... All jobs worked well for long time and staring the scripts manually woks just a it should be. I do not see any problem is the crontab, but sombody else might know more:

# man 1 crontab for acceptable formats:
#    <minute> <hour> <day> <month> <dow> <tags and command>
#    <@freq> <tags and command>

# SYSTEM DAILY/WEEKLY/... FOLDERS
@hourly         ID=sys-hourly   /usr/sbin/run-cron /etc/cron.hourly
@daily          ID=sys-daily    /usr/sbin/run-cron /etc/cron.daily
@weekly         ID=sys-weekly   /usr/sbin/run-cron /etc/cron.weekly
@monthly        ID=sys-monthly  /usr/sbin/run-cron /etc/cron.monthly

01  * * * * /usr/sbin/run-cron /etc/cron.hourly
05 00 * * * /usr/sbin/run-cron /etc/cron.daily
22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly

I had to remove the scripts from the cron.daily and cron.weeky directories for getting stability back.

Offline

#2 2010-01-31 10:58:43

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: cron getting mad?

I thnk the lines :

@hourly         ID=sys-hourly   /usr/sbin/run-cron /etc/cron.hourly
@daily          ID=sys-daily    /usr/sbin/run-cron /etc/cron.daily
@weekly         ID=sys-weekly   /usr/sbin/run-cron /etc/cron.weekly
@monthly        ID=sys-monthly  /usr/sbin/run-cron /etc/cron.monthly

replace the old syntax beginning with the explicit time.
So you should remove the old lines :

01  * * * * /usr/sbin/run-cron /etc/cron.hourly       
05 00 * * * /usr/sbin/run-cron /etc/cron.daily
22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly

and keep only the new syntax.
It's what I did and it works.

Offline

#3 2010-01-31 11:28:53

jcci
Member
From: China / Germany
Registered: 2007-06-10
Posts: 185

Re: cron getting mad?

I see! But how do I specify the start time for avoiding too much overlap between horly and daily tasks?
How do I specify any user specific cron job?
After studying the man page I understand that i.e. @hourly defines a job, but where the start time and frequency is defined? An update of the wiki would be super!

Offline

#4 2010-01-31 12:27:44

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Hi jcci, I'm the current developer of dcron. Yes, your crontab was requesting for the /etc/cron.daily jobs to be run twice. Here are your options. You'll only want to use one of the following:

@daily         ID=sys-daily          /usr/sbin/run-cron /etc/cron.daily
00 5 * * *                           /usr/sbin/run-cron /etc/cron.daily
*  1-5 * * *   ID=sys-daily FREQ=1d  /usr/sbib/run-cron /etc/cron.daily

The first says "try to run all the scripts in /etc/cron.daily once a day, I don't care when." When crond runs and sees that at least a day has passed since running this job, it will schedule it to run as soon as it can (not immediately after crond starts up, to avoid all the jobs running at once. But in this case, it should run about an hour after crond starts up, if more than a day has elapsed since last running that job).

The second says "try to run all the scripts in /etc/cron.daily every day at 5 am." If the computer isn't running at 5 am, then the jobs won't get run until the next 5 am. This may be perfectly adequate for your purposes, if the machine is always on.

The third says "try to run all the scripts in /etc/cron.daily, between the hours of 1-5 am, but do so only once a day." This gives crond a window in which it's allowed to run the job, and a frequency you want it to aim for.

I didn't realize Arch had a wiki page on cron, I'll look into bringing it up to date when I can (which probably won't be immediately). I welcome help with that from any other members of the community.

Now, as to why your daily cronjob was starting every ten minutes. This puzzles me. It sounds like there's some bug here that I haven't tracked down yet. I've had several other reports which suggest some bug leading to jobs being scheduled more frequently than they should. I haven't seen this behavior in my own testing, so I need help from those who are experiencing the problem. If you are able to help me, here's what you could do. First, stop crond:

sudo /etc/rc.d/crond stop  # or however you become root

Second, please put some jobs back into /etc/cron.daily. They don't need to be the resource-consuming scripts. They could be do-nothing scripts like this:

#!/bin/bash
true

Third, go to a terminal you don't need to use and execute this:

sudo /usr/sbin/crond -d &>> /tmp/cron.log  # this won't go into background

Now wait a day or so, or until you're sure crond is executing some jobs more often than it should. You can inspect the log by doing "tail -f /tmp/cron.log". When you've collected enough data, go back to the terminal where you started crond and control-C it to break. You can start up the regular crond daemon again by doing:

sudo /etc/rc.d/crond start

Please email me: (1) the /tmp/cron.log, (2) the output of "ls -lR /var/spool/cron /etc/cron.*", and (3) the output of "sudo crontab -l". Email them to profjim at jimpryor.net.

Last edited by Profjim (2010-02-08 11:37:52)

Offline

#5 2010-01-31 15:00:02

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Profjim wrote:

I didn't realize Arch had a wiki page on cron, I'll look into bringing it up to date when I can (which probably won't be immediately). I welcome help with that from any other members of the community.

I updated the wiki.

Offline

#6 2010-02-01 00:30:08

jcci
Member
From: China / Germany
Registered: 2007-06-10
Posts: 185

Re: cron getting mad?

Thank you very much for the first hand information. This kind of help is why I love this community - you are never alone!
I understand the options now, which means I either use my old crontab or the new but never together.
When checkong ps -A -F | grep daily I could see my scripts started several times the same day. In my errors log I could find that even more time the job were killed by lack of memory:

Jan 29 05:40:08 BMC-Server kernel: Out of memory: kill process 10846 (virusscan.sh) score 1697 or a child
Jan 29 05:40:08 BMC-Server kernel: Killed process 10848 (clamscan)
Jan 29 05:50:24 BMC-Server kernel: Out of memory: kill process 18478 (virusscan.sh) score 1687 or a child
Jan 29 05:50:24 BMC-Server kernel: Killed process 18480 (clamscan)

There were many more entrys... As you can see by the time it is just always 10 minutes adn 5:50 am, but cron started already 05 00 * * * /usr/sbin/run-cron /etc/cron.daily.
Hope it helps lightning up this issue.

Offline

#7 2010-02-01 01:37:04

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Thanks, but that doesn't suggest anything to me. Perhaps crond is responsible for starting too many scripts on your machine: I don't think we yet know for sure that would do that if your crontabs are fixed; but perhaps it would. And the multiple jobs may be making your machine run out of memory. But I need the kind of log output from cron that I described above to figure out why crond might be causing the too-frequent scheduling.

One quick fix you could try is to add "; exit 0" to the end of any jobs that are running too frequently. For instance:

@daily         ID=sys-daily          /usr/sbin/run-cron /etc/cron.daily; exit 0

One thing that's sure to make crond run the job again prematurely (in this case 72 minutes later) is if the job returns exit code 11. I don't expect that to happen very often by accident. But you could check and see; if this makes the problem go away, that's probably the explanation of why it was happening.

I suspect there's some more elusive issue here, though, and I'll need better logs to track it down.

Last edited by Profjim (2010-02-01 01:38:14)

Offline

#8 2010-02-01 15:36:35

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: cron getting mad?

I caught crond scheduling a job more than it should this morning. It appears that the retry logic for jobs which are still running may be at fault. Here's my experience:

At 9:30 a job with an @hourly schedule starts. This job has a bit to do on this run, so it will take 7 minutes to exit.

At 9:33 the job is still running. crond sees that the timestamp file hasn't been updated yet (since it didn't finish yet) and tries to start it, but then backs off because it's still running.

At 9:36 the same thing happens as at 9:33.

At 9:37 the job finishes successfully.

At 9:39 crond starts the job again, presumably based on treating the "job is still running" condition from 9:33 and 9:36 as a failure that needs to be rectified. The job now has very little to do and so finishes in seconds. crond now agrees that the job is complete and stops running it as desired.

I haven't confirmed the state of the timestamp file at any point in this - that's just my speculation. I didn't catch this in the act, but only noticed it afterward from the syslog output.

Offline

#9 2010-02-01 18:34:52

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Thanks, this might be helpful. I'll look into it as soon as I can.

Offline

#10 2010-02-02 08:46:48

Spider.007
Member
Registered: 2004-06-20
Posts: 1,174

Re: cron getting mad?

I have a few problems as well; the first one is that I missed the fact that dcron was updated to a new major version, and therefore the running instance didn't recognize the crontab (@-syntax) anymore

Secondly, I experienced the exact same problem as the topicstarter; I had to reboot my machine since my daily cron is a backup job; and this is what dcron did

Jan 31 14:45:40 spider010 crond[29044]: no timestamp found (user root job sys-daily)
Jan 31 15:57:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 9585 job sys-daily
Jan 31 16:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 9841 job sys-daily
Jan 31 16:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 10331 job sys-daily
Jan 31 16:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 10825 job sys-daily
Jan 31 16:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 11306 job sys-daily
Jan 31 16:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 11784 job sys-daily
Jan 31 16:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 12335 job sys-daily
Jan 31 17:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 12956 job sys-daily
Jan 31 17:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 13579 job sys-daily
Jan 31 17:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 14198 job sys-daily
Jan 31 17:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 14816 job sys-daily
Jan 31 17:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 15434 job sys-daily
Jan 31 17:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 16057 job sys-daily
Jan 31 18:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 16676 job sys-daily
Jan 31 18:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 17293 job sys-daily
Jan 31 18:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 17912 job sys-daily
Jan 31 18:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 18538 job sys-daily
Jan 31 18:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 19154 job sys-daily
Jan 31 18:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 19777 job sys-daily
Jan 31 19:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 20394 job sys-daily
Jan 31 19:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 21011 job sys-daily
Jan 31 19:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 21652 job sys-daily
Jan 31 19:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 22269 job sys-daily
Jan 31 19:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 22891 job sys-daily
Jan 31 19:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 23514 job sys-daily
Jan 31 20:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 24130 job sys-daily
Jan 31 20:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 24746 job sys-daily
Jan 31 20:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 25362 job sys-daily
Jan 31 20:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 25978 job sys-daily
Jan 31 20:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 26595 job sys-daily
Jan 31 20:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 27233 job sys-daily
Jan 31 21:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 27850 job sys-daily
Jan 31 21:12:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 28466 job sys-daily
Jan 31 21:22:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 29088 job sys-daily
Jan 31 21:32:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 29704 job sys-daily
Jan 31 21:42:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 30330 job sys-daily
Jan 31 21:52:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 30958 job sys-daily
Jan 31 22:02:01 spider010 crond[29044]: FILE /var/spool/cron/root USER root PID 31616 job sys-daily

Currently the daily jobs still run twice a day:

Feb  1 22:10:01 spider010 crond[8218]: FILE /var/spool/cron/root USER root PID 6606 job sys-daily
Feb  1 22:19:01 spider010 crond[8218]: FILE /var/spool/cron/root USER root PID 7721 job sys-daily
Feb  1 22:20:44 spider010 crond[8099]: mailing cron output for user root job sys-daily
Feb  2 00:23:43 spider010 crond[20957]: mailing cron output for user root job sys-daily

I have followed your post on how to collect debug-info; so I will update this thread tomorrow with the results. By the way, it seems the debug-output goes to stderr, so I suggest using '&>' instead of '>>'

Last edited by Spider.007 (2010-02-02 08:47:23)

Offline

#11 2010-02-02 11:33:34

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Spider.007 wrote:

I have followed your post on how to collect debug-info; so I will update this thread tomorrow with the results.

Terrific, thanks! You can email me the logs directly (profjim at jimpryor.net).

I missed the fact that dcron was updated to a new major version, and therefore the running instance didn't recognize the crontab (@-syntax) anymore

Sorry. Arch is against having package installs start and restart daemons. In retrospect, I guess we should have printed a message with an .install file warning users to immediately stop and restart their crond. But now we've missed the opportunity.

By the way, it seems the debug-output goes to stderr, so I suggest using '&>' instead of '>>'

Of course you're right. I've edited the original post. Thanks.

Last edited by Profjim (2010-02-02 11:40:18)

Offline

#12 2010-02-03 06:10:11

jcci
Member
From: China / Germany
Registered: 2007-06-10
Posts: 185

Re: cron getting mad?

My system is so far OK after changing the crontab:

# root crontab
# DO NOT EDIT THIS FILE MANUALLY! USE crontab -e INSTEAD

# man 1 crontab for acceptable formats:
#    <minute> <hour> <day> <month> <dow> <tags and command>
#    <@freq> <tags and command>

# SYSTEM DAILY/WEEKLY/... FOLDERS
#@hourly         ID=sys-hourly   /usr/sbin/run-cron /etc/cron.hourly
#@daily          ID=sys-daily    /usr/sbin/run-cron /etc/cron.daily
#@weekly         ID=sys-weekly   /usr/sbin/run-cron /etc/cron.weekly
#monthly        ID=sys-monthly  /usr/sbin/run-cron /etc/cron.monthly

01  * * * * /usr/sbin/run-cron /etc/cron.hourly
05 00 * * * /usr/sbin/run-cron /etc/cron.daily
22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly

But so far the were just daily jobs which consume much less time. The weekend will tell...
Anyway, I'm happy more competent people than myself picked up this issue.

Offline

#13 2010-02-03 08:49:45

Spider.007
Member
Registered: 2004-06-20
Posts: 1,174

Re: cron getting mad?

Profjim wrote:
Spider.007 wrote:

I have followed your post on how to collect debug-info; so I will update this thread tomorrow with the results.

Terrific, thanks! You can email me the logs directly (profjim at jimpryor.net).

I have sent the file to you

I missed the fact that dcron was updated to a new major version, and therefore the running instance didn't recognize the crontab (@-syntax) anymore

Sorry. Arch is against having package installs start and restart daemons. In retrospect, I guess we should have printed a message with an .install file warning users to immediately stop and restart their crond. But now we've missed the opportunity.

Yeah, it might be even better if the package could contain a flag that restarting should be required. That way pacman could update a list of packages and end with: To properly complete the installation please restart the following daemons: httpd, cron, mysql.

Offline

#14 2010-02-03 11:57:46

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Thanks for the logs, Spider.007. I identified at least one factor that was involved here, and fixed it. The problem was pretty much as ataraxia hypothesized.

Those of you who were experiencing these problems, could you try stopping crond (sudo /etc/rc.d/crond stop), installing dcron-git from aur, and then starting crond. Check your cron log every so often and tell me if your problems persist. Thanks.

Offline

#15 2010-02-04 16:16:33

Spider.007
Member
Registered: 2004-06-20
Posts: 1,174

Re: cron getting mad?

That sounds good!

Offline

#16 2010-02-05 17:32:17

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: cron getting mad?

I've been having the same problem—cron.daily gets run four times—for the same apparent reason: a script that takes about 15 minutes to execute.  I just installed dcron-git, and I'll report back tomorrow on whether it fixed the problem.  The following is my root crontab file.

@hourly     ID=sys-hourly               /usr/sbin/run-cron /etc/cron.hourly
* 2-5 * * * ID=sys-daily   FREQ=1d      /usr/sbin/run-cron /etc/cron.daily
* 2-5 * * * ID=sys-weekly  FREQ=1w/10m  /usr/sbin/run-cron /etc/cron.weekly
* 2-5 * * * ID=sys-monthly FREQ=30d/10m /usr/sbin/run-cron /etc/cron.monthly

Jay

Offline

#17 2010-02-07 05:20:36

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: cron getting mad?

Well, cron.daily only ran once last night, but the script that had been taking 15 minutes to run, finished in two minutes, so I'm not sure whether the problem has been fixed or not.

Jay

Offline

#18 2010-02-09 18:16:09

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: cron getting mad?

Since switching to crond-git, I'm still getting multiple runs of cron.daily on some days.  On February 6 and 8, the folder was run only once, but on Feb 7 it was run 3 times, and on Feb 9 it was run twice.  It is possible that the multiple runs on Feb 7 could have been legitimate, as I was doing system maintenance around that time, and I might have restarted my computer while cron.daily was being run.  However, there seems to be no justification for duplicate run on Feb 9.

Here are the relevant lines from crond.log:

Feb  6 03:28:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 14580 job sys-daily
Feb  6 03:34:12 jt512 crond[16793]: mailing cron output for user root job sys-daily
Feb  7 03:28:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 29788 job sys-daily
Feb  7 03:30:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 30636 job sys-daily
Feb  7 03:40:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 4734 job sys-daily
Feb  7 03:49:03 jt512 crond[7508]: mailing cron output for user root job sys-daily
Feb  7 03:49:36 jt512 crond[7639]: mailing cron output for user root job sys-daily
Feb  7 03:51:52 jt512 crond[8353]: mailing cron output for user root job sys-daily
Feb  8 03:40:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 16519 job sys-daily
Feb  8 03:45:54 jt512 crond[18433]: mailing cron output for user root job sys-daily
Feb  9 03:40:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 16209 job sys-daily
Feb  9 03:45:01 jt512 crond[5218]: FILE /var/spool/cron/root USER root PID 18096 job sys-daily
Feb  9 03:45:44 jt512 crond[18593]: mailing cron output for user root job sys-daily
Feb  9 03:48:15 jt512 crond[19396]: mailing cron output for user root job sys-daily

And here is my root crontab file:

@hourly     ID=sys-hourly               /usr/sbin/run-cron /etc/cron.hourly
* 2-5 * * * ID=sys-daily   FREQ=1d      /usr/sbin/run-cron /etc/cron.daily
* 2-5 * * * ID=sys-weekly  FREQ=1w/10m  /usr/sbin/run-cron /etc/cron.weekly
* 2-5 * * * ID=sys-monthly FREQ=30d/10m /usr/sbin/run-cron /etc/cron.monthly

$ cat /var/spool/cronstamps/root.sys-daily
2010-02-09 03:45

Please let me know what else I can do to help diagnose this problem.

Jay

Last edited by jt512 (2010-02-09 18:17:36)

Offline

#19 2010-02-11 20:31:14

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: cron getting mad?

Still getting two to four runs of cron.daily per day.

Jay

Offline

#20 2010-02-11 23:39:22

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: cron getting mad?

Thanks, I'm looking into it.

Offline

#21 2010-02-23 16:25:56

fishman
Member
Registered: 2010-02-23
Posts: 6

Re: cron getting mad?

Well, maybe there is a problem with a timeout or something like that.
Because the problem only occurs if I put a large cronjob (2-3 hours) into the cron.daily folder.
If remove this big job the whole cron-system works without a problem.

I solved the problem through removing the job and adding the line " 05 01 * * * /root/backup.py " to /var/spool/cron/root

It worked for me smile I hope there will be a fix someday smile

Thanks

Last edited by fishman (2010-02-23 17:59:03)

Offline

#22 2010-09-17 10:47:23

giddie
Member
From: Birmingham, UK
Registered: 2009-03-25
Posts: 125

Re: cron getting mad?

Hi there; I apologise if the bump is unwelcome.  I've started noticing this issue after adding a long-running backup task to a system yesterday.  I have dcron 4.4-2, and got the following:

Sep 16 21:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 30194 job sys-hourly
Sep 16 23:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 30948 job sys-hourly
Sep 17 01:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 31717 job sys-hourly
Sep 17 03:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 32470 job sys-hourly
Sep 17 05:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 790 job sys-hourly
Sep 17 07:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 1570 job sys-hourly
Sep 17 09:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 2673 job sys-hourly
Sep 17 11:02:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 3177 job sys-daily
Sep 17 11:05:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 3784 job sys-daily
Sep 17 11:05:52 lemlin01 crond[3808]: mailing cron output for user root job sys-daily

Notice how: 1) The hourly job seems to be skipping an hour; and 2) The daily job (with the new long-running task) was run twice.  The second run of sys-daily failed because the process in question aborted when it found that the previous instance was still running.

Let me know if there's anything else I can provide that might help you diagnose the problem.

edit: BTW, the hourly skip has been going on since I set up the system (21st June), according to the log.

Last edited by giddie (2010-09-17 10:52:05)

Offline

#23 2010-09-17 10:50:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: cron getting mad?

giddie wrote:

Hi there; I apologise if the bump is unwelcome.  I've started noticing this issue after adding a long-running backup task to a system yesterday.  I have dcron 4.4-2, and got the following:

Sep 16 21:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 30194 job sys-hourly
Sep 16 23:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 30948 job sys-hourly
Sep 17 01:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 31717 job sys-hourly
Sep 17 03:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 32470 job sys-hourly
Sep 17 05:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 790 job sys-hourly
Sep 17 07:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 1570 job sys-hourly
Sep 17 09:50:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 2673 job sys-hourly
Sep 17 11:02:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 3177 job sys-daily
Sep 17 11:05:01 lemlin01 crond[1484]: FILE /var/spool/cron/root USER root PID 3784 job sys-daily
Sep 17 11:05:52 lemlin01 crond[3808]: mailing cron output for user root job sys-daily

Notice how: 1) The hourly job seems to be skipping an hour; and 2) The daily job (with the new long-running task) was run twice.  The second run of sys-daily failed because the process in question aborted when it found that the previous instance was still running.

Let me know if there's anything else I can provide that might help you diagnose the problem.

Yes, we know about the problems with cron: https://bugs.archlinux.org/index.php?string=cron

Offline

Board footer

Powered by FluxBB