Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Any solutions? Does the line mean: "Run this script every day at hour:01"?
That's a dangerous thing to do, since CRON will have to fire up, and run your script. If it runs more than 1 minute, you'll then have TWO running...etc, .etc......
Why not just run the script one time (system startup?), and put a "sleep 60" statement in it, and loop back to the beginning?? That way, even if it takes 5 minutes to execute, it'll finish ONE loop, sleep 60 seconds, then run again, instead of cranking off 5 fresh copies...
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254
Original Poster
Rep:
Quote:
Originally Posted by TB0ne
That's a dangerous thing to do, since CRON will have to fire up, and run your script. If it runs more than 1 minute, you'll then have TWO running...etc, .etc......
Why not just run the script one time (system startup?), and put a "sleep 60" statement in it, and loop back to the beginning?? That way, even if it takes 5 minutes to execute, it'll finish ONE loop, sleep 60 seconds, then run again, instead of cranking off 5 fresh copies...
"system startup": that would require the system or server to bed rebooted at least once after a script has been scheduled to be executed at Startup.
Well, in production servers we cannot reboot servers like that. Besides, running a job every minute is not what we (or at least I) would do. It is just a problem!
Anyways, I have done it.
Code:
*/59 * * * * /root/bin/at60.sh
That would run the script every minute (or 59 seconds.) In fact, I tried
Code:
*/60 * * * * /root/bin/at60.sh
as well. It too worked. But the value that can come there should be 0-59.
"system startup": that would require the system or server to bed rebooted at least once after a script has been scheduled to be executed at Startup.
Was a *SUGGESTION*, and NOT the only way to run a script.
Quote:
Well, in production servers we cannot reboot servers like that. Besides, running a job every minute is not what we (or at least I) would do. It is just a problem!
You don't have to...it's a SCRIPT, just run it. However you choose to...command line, rc.local, whatever.
Quote:
Anyways, I have done it.
Congratulations...the first time the script takes over 60 seconds to process, enjoy the results.
GUI is for kids! No matter how many key strokes a command or task may require, I would prefer the old command line interface or console.
Well, I am using PUTTY to login remotely on the server.
So I'M a 42 year old kid then, thanks for that.
We all have to start somewhere and if Linux was not so fiddly and picky, it may have a chance at kicking windows off the top slot... but it isn't.
As for the comment, it was only a suggestion to solve a problem quickly, sometimes the method or means of performing a task are less important than the actual outcome.
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254
Original Poster
Rep:
Quote:
Originally Posted by \\.\
So I'M a 42 year old kid then, thanks for that.
We all have to start somewhere and if Linux was not so fiddly and picky, it may have a chance at kicking windows off the top slot... but it isn't.
As for the comment, it was only a suggestion to solve a problem quickly, sometimes the method or means of performing a task are less important than the actual outcome.
I respect your age and experience, sir. Please, don't mind my comment. I am sometimes a kind of "showing-humour".
Well, I agree to what you have said:
Quote:
"Sometimes the method or means of performing a task are less important than the actual outcome."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.