4 ms·
Another tip for automated cronjobs is if a job is going to go over the time (IE: if you have it running every hour and it might run over an hour) use a file loc
by rick888 15y ago
Another tip for automated cronjobs is if a job is going to go over the time (IE: if you have it running every hour and it might run over an hour) use a file lock to make sure they won't run at the same time.
- coreymaass 15y agoOh, that's a great suggestion!
- lobster_johnson 15y agoYep. I use the flock tool (comes with most Linux distros, I assume) for this: flock -nx /var/run/myscript.lock /usr/bin/myscript This will run the script while keeping a lock. If there is a lock, it will quit immediately.