* C:\DEV\DOEVERY\DOEVERY.TXT **** 15 OCT 96 ** 12:31 ******; G W Robinson


                      R A L   P C   U S E R   G U I D E
                      ---------------------------------

                  DOEVERY utility to do things at intervals
                  -----------------------------------------



      1. Introduction
      ===============

      DOEVERY is a program to allow something to be done at intervals.
      Its main use would be in a regularily run BAT file, such as
      AUTOEXEC.BAT, where it could be used to say run an anti-virus
      program once a week, do a daily clean up of the temporary files,
      take an incremental backup once every two days and a full backup
      once a month. The current relase is v1.1.


      2. Program Specification
      ========================

      Doevery v1.1 format is:

        doevery /options @do_interval #first_time do_action

      Unless overidden by #first_time the first time DOEVERY is run it
      does do_action once and then does not do it again until it is run
      after do_interval has passed.  DOEVERY returns an ERRORLEVEL of 0
      if do_action is done otherwise it returns 1.

      Do_interval, which is optional, is a string which uniquely defines
      a day of the week (Monday, Tu, Wed, ...) or a time interval
      (minute, hour, day, week, month, year).  By default units smaller
      than the do_interval unit in the current date & time are ignored
      when do_interval is added.  Thus a do_interval of an hour would
      end at the start of the next hour, a day at the start of the next
      day, a month at the start of next month etc.  This can be
      overidden by #first_time.  Note that @week is equivalent to
      @sunday.  A number may optionally preceed the interval which
      multiplies it up (2hour, 5days, 2tues).  The default value of
      do_interval is 1d.

      By default DOEVERY keeps its configuration information in the C:\
      directory in a filename of the do_interval and filetype .doe.

      Do_action, which is optional, may define a program or BAT file
      which is to be run at each do_interval.  Whatever the outcome when
      do_action is run DOEVERY returns an ERRORLEVEL of 0 so the only
      way to discern the outcome of do_action is to run it via a BAT
      file. If do_action is not specified then the ERRORLEVEL returned
      by DOEVERY must be tested to discern if the time interval has
      passed.

      First_time is optional and, if present, it defines the time and
      date for the first run of do_action.  Thus if this time and date
      has not been reached then no action will be taken on the first
      invocation of DOEVERY.  First_time is of the form:

      hr:min/day/month/year

      where the time and date are all numerical, maximum 2 digits, and
      separated by a single none alphanumeric character except a space.
      If only part of the time/date is supplied then the current
      time/date is used to supply the missing values.

      An example would be:

      #12:00/2/7/96

      which would not run do_action unless or until it was currently
      past 12:00 on 2 July 1996.

      Where first_time is specified then the first_time values of units
      smaller that the do_interval unit are added to it for the first
      and all subsequent intervals.  Thus on the above example if the
      interval was a day then the hours and minutes of first_time would
      be added to the interval and do_action would not happen until
      after 12:00 each day.

      Possible options are:
        ?  Give this help information
        h  Give this help information
        ifile_path  Redefine control file from default of
           c:\do_interval.doe
        p  Prompt before running do_action. If no reponse after 30
           seconds then proceed as normal. /t can redefine time waited.
        r  Reset control file settings - test facility
        s  Silent option - run without giving any messages except for
           errors.
        tnumber  Define number of seconds to wait for reponse to /p
           option. Default is 30 seconds.


      3. Examples
      ===========

      doevery do.bat    Run DO.BAT and return an ERRORCODE of 0. Then
                        Return ERRORCODE of 1 for every subsequent run
                        until the first run after 00:00 on the next and
                        subsequent days.

      doevery /p f-prot.exe   As first example but run program
                              F-PROT.EXE and prompt whether to run or not.

      doevery @tues do_bat    As first example but run DO_BAT every
                              Tuesday.

      doevery @2weeks do_bat  As first example but run DO_BAT on or
                              after the start of every second week
                              (Sunday). Nb. @Sun = @Week

      doevery #12:00  do_bat  As first example but dont run until after
                              12:00 on each day.

      doevery @month #12:00/20/1/97 do_bat
                              As first example but dont run until after
                              12:00 of 20 January 1997 and then run on
                              or after 12:00 on the 20th of each month.

      doevery @3days /s /ic:\doevery.ini do_bat
                              As first example but do every 3 days
                              without giving any messages and keep
                              configuration file in C:\DOEVERY.INI.



      4. Additional Notes
      ===================

      Because DOEVERY keeps its control data in a filename named after
      the do_interval it is possible to have many uses of DOEVERY
      without any clashes.  The main problem occurs when there are
      several things that need to be done on the same time interval.
      This can be overcome by using the ERRORLEVEL reply as illustrated
      below but it may be simpler to use different definitions of the
      same do_interval.  For example a daily action could be defined as
      one of:  @day, @1day, @1days and @daily, all of which generate a
      different control file name (day.doe, 1day.doe, 1days.doe,
      daily.doe).

      If an interval of say @7days is used then this will run do_action
      seven days later.  Thus if DOEVERY were first run on a Monday it
      would repeat every Monday until you had a Monday when the PC was
      not used.  If the PC was next used on Tuesday then do_action would
      then run and repeat on every subsequent Tuesday.  Better to
      specify a day of the week if this is what is required.

      The option /r can be used to test out the system and see what
      various settings achieve.  It must not be included in a BAT file
      which uses DOEVERY since it resets the control file settings.


      5. Usage Guidelines
      ===================

      The following might appear in the file AUTOEXEC.BAT in order to do
      things at certain intervals.  The ERRORLEVEL is used so that more
      than one action may be done daily. The weekly and monthly calls
      have only one action so are done direct.

        doevery @day
        IF ERRORLEVEL 1 GOTO NOT_DAILY
        REM Do every day - eg. empty TEMP directory and check Mail
        REM attachments directory for Word Macro viruses
        del c:\temp\*.* /Q
        f-prot c:\mail\attach

        :NOT_DAILY

        REM Do every Monday - eg. run F-Prot anti-virus program
        REM Prompt the user and wait for upto 60 seconds before running.
        doevery /pt60 @monday f-prot c:\*.*

        REM Do every month - eg. SCANDISK
        doevery /p @month scandisk

      Where the user prompting provided by the /p option is not adequate
      the RAL utility WHATNOW can be used.  For example the monthly
      entry above could become.

        doevery @month
        IF ERRORLEVEL 1 GOTO NOT_MONTH
        whatnow /t 30 ny y Can you wait while I scan the disk?
        REM Y gives ERRORLEVEL 2 and is default after 30secs. N gives 1.
        IF ERRORLEVEL 2 GOTO DO_MONTH
        REM Wants me to try next time so delete control file else wont
        REM get run again for another month!
        del c:\month.doe
        GOTO :NOT_MONTH

        :DO_MONTH
        REM Do every month - eg. SCANDISK
        scandisk

        :NOT_MONTH


      6. Differences in DOEVERY versions
      ==================================

      6.1 Version 1.0
      ---------------

      Initial release. V1.0a fixed minor bugs.

      6.2 Version 1.1
      ---------------

      Fixed problems with year 2000. Date format in control files now
      uses four digit year rather than two.


      7. Support
      ==========

      DOEVERY is supplied free and are supported for all users at RAL
      who are registered with CISD PC Support.

      Users outside RAL are requested in the first instance to obtain
      copies and help from their normal support sources.

      Academic user support organisations may seek help from RAL but the
      latter will only be given on a 'best endeavours' basis.

      There is no support for other organisations other than by private
      arrangement with the author.

      Updates of the software may be obtained by anonymous FTP from
      FTP.CC.RL.AC.UK (currently 130.246.12.16).  It is held in a self
      extracting binary file DOEVERYxx.EXE (xx being version number
      without a point - currently 10) in directory
      /pub/pcsupp/dos/doevery.  Executing the file will produce the
      program and documentation.

      WHATNOW can also be obtained from the same service in a self
      extracting binary file WHATN10.EXE in directory
      /pub/pcsupp/dos/whatnow.

      Bug reports or problems should be reported, ideally by email, to
      Graham Robinson:

      E-mail: Graham.Robinson@rl.ac.uk    G W Robinson
      Tel UK: 01235 44 5636               Rutherford Appleton Laboratory
      Int'l : +44 1235 44 5636            Chilton, Didcot
      Fax   : 01235 44 5281               Oxon, OX11 0QX,UK

