                           BACKUP

1.0 Introduction.

BACKUP is a console application designed to be run by the Windows scheduler
at a given time of day. It parses its arguments ("command") for certain
strings, replacing them appropriately. It then launches the resulting command.

For BACKUP to work properly, the environmental variable PATH must be defined
to reach the command interpreter, which is standardized as CMD, the same name
Windows 2000/XP gives to its command interpreter. Also this path should
reach all commands that will be used, such as "xcopy".

For Windows 2000/XP, the PATH statement is defined in
%systemroot%\system32\autoexec.nt. For instance, if your Windows directory
is called "WINNT" then you would place the following in autoexec.nt:

PATH = C:\WINNT\SYSTEM32;%PATH%

For Windows 98/ME, the PATH statement is defined in c:\autoexec.bat. Simply
place a copy of command.com in the c:\windows\command directory, renaming it
cmd.com. Then you would place the following in autoexec.bat:

PATH = C:\WINDOWS\COMMAND;%PATH%


2.0 BACKUP replacement strings.

The command line replacement strings are as follows:

/*askwin*/     - prompts user to enter a keystroke to close BACKUP window
*yymmdd*       - current year/month/day
*yymmdd-days*  - current year/month/day less days i.e. *yymmdd-10*
*yymmdd+days*  - current year/month/day plus days i.e. *yymmdd+10*
*yymm*         - current year/month
*yy*           - current year
*xxmmdd*       - previous year/month/day
*xxmmdd-days*  - previous year/month/day less days i.e. *xxmmdd-10*
*xxmmdd+days*  - previous year/month/day plus days i.e. *xxmmdd+10*
*xxmm*         - previous year/month
*xx*           - previous year
`              - replaced with "

An example of BACKUP commands that keep 30 days of backups:

echo off
backup rd/s/q d:\backups\*yymmdd-30*
backup xcopy/e/i/q/h/r/k/y c:\`documents and settings`\`john smith`\`my documents` d:\backups\*yymmdd*

An example of a BACKUP command that displays the backup directory:

echo off
backup dir/od d:\backups\*yymmdd* /*askwin*/


3.0 BACKUP command file execution.

BACKUP has the ability to replace a series of strings with another in a given
file, creating a new file which is then subsequently added into the BACKUP
command line.

The syntax is:

backup #@out_file inp_file $inpstr1$outstr1$ $inpstr2$outstr2$...#

Note:

"$" in the parameters "$inpstr*$outstr*$" could have been any character
that was not a part of "inpstr*" or "outstr*".

For instance, if you wished to launch a command file yyy.cmd which
was the result of copying the file xxx.cmd in which all strings "abc"
were replaced with the current date and all strings "def" were replaced
with the previous date you would issue the following BACKUP command:

backup #@yyy.cmd xxx.cmd $abc$*yymmdd*$ $def$*xxmmdd*$#

where xxx.cmd is a file containing the lines:

                   dir abc
                   dir def

Assuming today's date is 041025, the result of this operation would be the
execution of the file yyy.cmd containing the lines:

                   dir 041025
                   dir 031025
