Use the time in a script?
Rick Jones
rick at tetrauk.UUCP
Fri Sep 28 23:32:11 AEST 1990
In article <14183 at hydra.gatech.EDU> ce1zzes at prism.gatech.EDU (Eric Sheppard) writes:
>I would like to make sure that a script or program is not executed during
>a certain period of every hour. Is there an elegant method to achieve this,
>short of an additional C program?
The "date" command can be made to give you any selected date or time info with
a format string. e.g. date +%M prints the minutes (check-out the man page!).
Thus to block operation between say 20 & 40 mins past each hour:
minmins=20 maxmins=40
mins=`date +%M`
if expr $mins \> $minmins \& $mins \< $maxmins > /dev/null
then
echo No dice
exit 1
fi
Adjust the logic to suit.
--
Rick Jones The definition of atomic:
Tetra Ltd. from the Greek meaning "indivisible"
Maidenhead, Berks, UK So what is:
rick at tetrauk.uucp an atomic explosion?
More information about the Comp.unix.questions
mailing list