Re: Changing cron from a script?

From: Ross Alexander (ralexan9@telusplanet.net)
Date: Mon Feb 02 2004 - 14:53:11 EST


On Mon, 2 Feb 2004, Bill Verzal wrote:

> The simplest (but maintenance nightmarish) routine would be 2 crontabs and
> just mv them and "crontab" them.
>
> BV
> --------------------------------------------------------
>
> "If everything is coming your way, then you are in the wrong lane"
>
> Bill Verzal
> AIX Administrator, Komatsu America
> (847) 970-3726 - direct
> (847) 970-4184 - fax

It might be easiest to conditionalize from within the crontab:

0 * * * * if [ ! -f /my/control/file ] ; then /my/interfering/script; fi

and wrap your backup with 'touch /my/control/file' and 'rm /my/control/file' as
appropriate. Note that crontab lines aren't ksh, they're Bourne shell syntax.

regards,
Ross

>
>
> "Lieberg,
> Patrick"
> <plieberg@EV3.NET To
> > aix-l@Princeton.EDU
> Sent by: IBM AIX cc
> Discussion List
> <aix-l@Princeton. Subject
> EDU> Changing cron from a script?
>
>
> 02/02/2004 11:55
> AM
>
>
> Please respond to
> IBM AIX
> Discussion List
> <aix-l@Princeton.
> EDU>
>
>
>
>
>
>
> This seems like it should be simple, but my brain isn't able to wrap itself
> around the problem this morning. Perhaps its all the snow.
>
> My weekly backup stops our production databases and I'd like to comment out
> some cron jobs so they don't generate a bunch of errors while the backup is
> running, then uncomment them when the backup completes. Anyone have a good
> ksh syntax for how to edit a crontab file from a ksh script?
>
> -Patrick Lieberg
> Systems Engineer
> ev3 Inc.
>
> _____________________________________________________________________
> This message has been checked for all known viruses
>

--
Ross Alexander
(780) 433 6725 home
ralexan9@telusplanet.net


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:34 EDT