Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!pyrltd!tetrauk!rick From: rick@tetrauk.UUCP (Rick Jones) Newsgroups: comp.unix.questions Subject: Re: Use the time in a script? Message-ID: <743@tetrauk.UUCP> Date: 28 Sep 90 13:32:11 GMT References: <14183@hydra.gatech.EDU> Reply-To: rick@tetrauk.UUCP (Rick Jones) Organization: Tetra Ltd., Maidenhead, UK Lines: 26 In article <14183@hydra.gatech.EDU> ce1zzes@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@tetrauk.uucp an atomic explosion?