Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Is this a daily thing or ongoing reboot type thing? If so, why dont you just move your crons that should be running during downtime to another time? If not and only a rare occasion, just manually run them would be the easiest way.
It's a daily thing. The problem is that I want the outdated script running when the machine comes up and I may not be available at that time. I want that the machine launch the script automaticaly, not by my hand.
Originally posted by bujecas It's a daily thing. The problem is that I want the outdated script running when the machine comes up and I may not be available at that time. I want that the machine launch the script automaticaly, not by my hand.
If you have your machine shutdown at 05:00 and rebooted at 10:00, why not have the cron kickoff at like 10:10? If you know your system is down for 5 hours each day, I find it pointless to work around any cron jobs you have setup to run during that time when the machine isn't even running. Why make things harder than they have to be?
Or if you definitly want these to run right at bootup, why not set them up in your startup scripts?? I think your making this more complicated than it really is.
Your're not getting my point. The machine doesn't shuts down every day at 05:00 and boots at 10:00, that was an example. The point is if the power fails and the machine goes down for a indeterminated period, there must be a mechanism to start the cronjobs that were supposed to run at that dead period.
You could write a quick script to just run _all_ cron jobs on a reboot, or try to figure out (based on the current time and the last shutdown time) if any didn't get run.
I'd say it's doable through bash scripting though, but there isn't a magic program (that I'm aware of) that can "queue" up cron jobs or anything like that.
Originally posted by bujecas Your're not getting my point. The machine doesn't shuts down every day at 05:00 and boots at 10:00, that was an example. The point is if the power fails and the machine goes down for a indeterminated period, there must be a mechanism to start the cronjobs that were supposed to run at that dead period.
I guess when you say: "It's a daily thing" kind of threw me off thinking that it actually happens daily..
Well, you'll need to write a script that checks what crons ran and which one's didn't during a downtime period.. verify against the times in your crontab and then most likely in the logs. Then have that script run at startup to verify and run what is necessary, etc. But you'll definitly need to make sure all your cron jobs create some type of output in a log or make the script check when the last time the server shutdown and then started up, take that downtime period and check it against your cron entries and kick off anything that fell in that downtime window..