|
Prev: Shell script to do like winmerge.... :)
Next: how to get the hostnames and memory usage biger than 30M?
From: Zinger on 15 Apr 2008 09:10 Hi, I have a scheduled cronjob that runs after every 15 minutes on 24 hrs basis. */15 * * * * /opt/bea/healve/scripts/monitoring/run.sh I want to suspend it between the hours of 2AM and 4:30AM. One option is that I create another job to take the execution permissions away from the run.sh script at 2AM and give it back at 4:30AM. Is there a neater way of doing it? Pls help Thanks
From: pk on 15 Apr 2008 09:42 On Tuesday 15 April 2008 15:10, Zinger wrote: > I have a scheduled cronjob that runs after every 15 minutes on 24 hrs > basis. > > */15 * * * * /opt/bea/healve/scripts/monitoring/run.sh > > I want to suspend it between the hours of 2AM and 4:30AM. > > One option is that I create another job to take the execution > permissions away from the run.sh script at 2AM and give it back at > 4:30AM. Is there a neater way of doing it? Can't you do something like this in the script: .... h=`date +%H%M` if [ $h -gt 200 ] && [ $h -lt 430 ]; then exit; fi ....go on as usual... or, with bash: if [[ "$h" > "0200" ]] && [[ "$h" < "0430" ]]; then exit; fi
From: Bill Marcum on 15 Apr 2008 10:15
On 2008-04-15, Zinger <zmasood(a)gmail.com> wrote: > > > Hi, > > I have a scheduled cronjob that runs after every 15 minutes on 24 hrs > basis. > > */15 * * * * /opt/bea/healve/scripts/monitoring/run.sh > > I want to suspend it between the hours of 2AM and 4:30AM. > > One option is that I create another job to take the execution > permissions away from the run.sh script at 2AM and give it back at > 4:30AM. Is there a neater way of doing it? > */15 0-1,5-23 * * * /opt/bea/healve/scripts/monitoring/run.sh 30,45 4 * * * /opt/bea/healve/scripts/monitoring/run.sh |