LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-24-2005, 10:03 AM   #1
Utah
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 73

Rep: Reputation: 15
What does cron do if machine is down when job is scheduled?


Hi,

Does cron keep track of jobs that didn't get run because the machine was down for some reason when the job was scheduled to run and then run those jobs when the machine is back up again?

And, if not, how do sys admins deal with important jobs that might get forgotten if there was an unscheduled shutdown over the time when the job was scheduled?

Thanks,

Mike Jewell
 
Old 08-24-2005, 10:16 AM   #2
klatch
LQ Newbie
 
Registered: Feb 2004
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
I use Fedora Core 1 for my home server. That does indeed run cron jobs that should have run while the machine is down.

If for example you have a daily backup, but shut the machine down while you are on holiday for a week the daily will run ONCE when you power the machine back up. For some reason mine waits 64 odd minutes to run the cron job though.

Robert
 
Old 08-24-2005, 10:21 AM   #3
swede
LQ Newbie
 
Registered: Jul 2005
Location: Wyoming
Distribution: Slackware
Posts: 15

Rep: Reputation: 0
anacron
 
Old 08-24-2005, 10:21 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Re: What does cron do if machine is down when job is scheduled?

Quote:
Originally posted by Utah
Hi,

Does cron keep track of jobs that didn't get run because the machine was down for some reason when the job was scheduled to run and then run those jobs when the machine is back up again?

And, if not, how do sys admins deal with important jobs that might get forgotten if there was an unscheduled shutdown over the time when the job was scheduled?

Thanks,

Mike Jewell
Depends on the distribution or admin, if they have something in place to run cron jobs that were missed.

A good sysadmin should know if a machine is down and it has cron jobs, once he brings it backup to run whatever needs to be run. Some put monitors in place, I'm sure others will run them manually. If your the admin, you decide what's best for you.
 
Old 08-24-2005, 08:23 PM   #5
Utah
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 73

Original Poster
Rep: Reputation: 15
Thanks for the suggestions. Using anacron seems like it might make lots of sense. I need to read the man pages a few more times...

For now, I came up with a little hack for my one and only cron job (to send a monthly email to an address to check that forwarding is still being done). I just added another cron job that runs every day at noon (when my machine is almost always up) and checks if the logfile from the first (mailing) cron job is older than, say, 31 days. If so, then that job must not have run on schedule so it runs it now. This would not be a good solution in general but for my simple case, it gets the job done. (so to speak...) 8^)

Utah

Mike Jewell
One-Up Audio
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron - doesn't seem to run scheduled tasks robintw Linux - General 11 11-25-2005 02:53 AM
How to avoid mail from at scheduled job? bomix Linux - Software 3 06-30-2005 07:22 PM
guaranteed scheduled job execution Xstack Programming 4 02-15-2005 11:30 PM
creating a cron(tab) scheduled thing student04 Linux - Software 5 12-26-2004 10:18 PM
cron job the_rhino Linux - Newbie 10 10-02-2004 04:34 PM


All times are GMT -5. The time now is 04:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration