Leon Fauster
2019-Feb-12 12:57 UTC
[CentOS] dont run cron.d- when cron.daily-scripts are running
EL6 context: cronie-1.4.4-16.el6_8.2.x86_64 cronie-anacron-1.4.4-16.el6_8.2.x86_64 crontabs-1.10-33.el6.noarch I have some cron.d entries that execute scripts in minute intervals and I'm wondering how could an "official" way look like, to have a condition to not run cron.d entries when cron.daily scripts are running. Sure, I can hack something around file timestamps or so but that feels not so streamlined ... I'd really appreciate any ideas ... -- LF
Leroy Tennison
2019-Feb-12 13:37 UTC
[CentOS] dont run cron.d- when cron.daily-scripts are running
Well, this is anything but elegant, but if your daily occurs at an exact hour and minute you could write two series of per minute cron jobs (a "before' and an "after") avoiding that minute. Leroy Tennison Network Information/Cyber Security Specialist E: leroy at datavoiceint.com 2220 Bush Dr McKinney, Texas 75070 www.datavoiceint.com This message has been sent on behalf of a company that is part of the Harris Operating Group of Constellation Software Inc. These companies are listed here . If you prefer not to be contacted by Harris Operating Group please notify us . This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. ________________________________________ From: CentOS <centos-bounces at centos.org> on behalf of Leon Fauster via CentOS <centos at centos.org> Sent: Tuesday, February 12, 2019 6:57 AM To: CentOS mailing list Subject: [EXTERNAL] [CentOS] dont run cron.d- when cron.daily-scripts are running EL6 context: cronie-1.4.4-16.el6_8.2.x86_64 cronie-anacron-1.4.4-16.el6_8.2.x86_64 crontabs-1.10-33.el6.noarch I have some cron.d entries that execute scripts in minute intervals and I'm wondering how could an "official" way look like, to have a condition to not run cron.d entries when cron.daily scripts are running. Sure, I can hack something around file timestamps or so but that feels not so streamlined ... I'd really appreciate any ideas ... -- LF _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
Gordon Messmer
2019-Feb-12 16:02 UTC
[CentOS] dont run cron.d- when cron.daily-scripts are running
On 2/12/19 4:57 AM, Leon Fauster via CentOS wrote:> I have some cron.d entries that execute scripts in minute intervals and I'm wondering how could an > "official" way look like, to have a condition to not run cron.d entries when cron.daily scripts are > running. Sure, I can hack something around file timestamps or so but that feels not so streamlined ...run-parts doesn't look like it produces a lock, so I'd venture that the simplest way would be: */5 * * * *?? root pidof -x run-parts || your-command-here
Leon Fauster
2019-Feb-13 11:29 UTC
[CentOS] dont run cron.d- when cron.daily-scripts are running
> Am 12.02.2019 um 17:02 schrieb Gordon Messmer <gordon.messmer at gmail.com>: > > On 2/12/19 4:57 AM, Leon Fauster via CentOS wrote: >> I have some cron.d entries that execute scripts in minute intervals and I'm wondering how could an >> "official" way look like, to have a condition to not run cron.d entries when cron.daily scripts are >> running. Sure, I can hack something around file timestamps or so but that feels not so streamlined ... > > > run-parts doesn't look like it produces a lock, so I'd venture that the simplest way would be: > > */5 * * * * root pidof -x run-parts || your-command-here >Thats a nice solution! Pragmatic and more accurate than the path I was on. Thanks! -- LF
Reasonably Related Threads
- dont run cron.d- when cron.daily-scripts are running
- dont run cron.d- when cron.daily-scripts are running
- bash script fails conditional test
- Bug#717575: xcp-storage-managers: Wrong path of pidof in /usr/lib/xcp/sm/iscsilib.py
- capturing pid from command line