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.
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 there any way I can stop my cronjobs overlapping ?
I have shell scripts called from crontab which rsnap/rsync all the data from my remote servers to a main backup server. One remote server (of 7) is backed up each night plus another backed up every morning.
I've come in this morning to find that last night's has not yet completed and this morning's has already started.... so the network is too busy for some staff to work :-(
Is there a way I can tell crontab to not start a job until a running job has completed ?
If they are dependent jobs, use the lock file, otherwise use the ps solution.
Reasons: if dependent, you don't want the 2nd job to run even if the 1st one crashes (lock file is not removed).
If you only need them to not overlap in time (as seems to be the case here),the 2nd job should still run, even if the first one crashes, ie so long as the 1st one is not actively running...
Ah, thanks for that tip Chris. At the moment the scripts are not dependent so I'll use the ps method. At some time in the near future I am planning to modify them - run the rsync script and when completed tar entire backup directory and move to an archive. When I start using that I will probably need to employ lock file method.