TABLE OF CONTENTS - TreeBac v. 2.08

Operating system
Minimum requirements
Description
Installation
Syntax
Quick help
Quick info
Arguments
  source directory
  target directory
  options
    options to synchronize source and target directories
    options to make backup more secure
    options to specify which files are copied
    options to compress files while copying
    options to control logging of results
    options useful in batch files
Errorlevel
Examples
Stop process
How to contact the author
Registration
Source code
Responsability
History                                                                                 

*******************************************************************

Operating system

   TreeBac has been tested in MS-DOS version 3.3 to 6.22
   TreeBac is intended to be used in pure MS-DOS where files
   follow the 8.3 format i.e. 8 spaces for the filename and
   3 spaces for the extension.  It is not designed to be use in Windows
   MS-DOS mode where long filenames are present.

Minimum requirements

   This program is a protected mode DOS extended executable.
   It will only run on a 80286 processor or above with a
   minimum of 1-2 Mb of available extended memory.

Description

   TreeBac is a DOS command line utility used to perform a backup of
   a directory tree to another directory.
   It does recursion inside sub-directories up to any number of levels.
   
   TreeBac looks at the date and time stamps of the corresponding
   files in the source and the backup directories.  It will only copy
   a file from source to backup if :

   (a) the file on the source is absent on the backup directory.
   (b) the file on the backup directory has an older stamp than
       the file on the source directory
       ( i.e. the source file has been modified since the last backup).

   It has a rare feature : you may specify to backup only some of the
   source first level sub-directories (with all their sub-directories)
   based on their minute stamps.

   TreeBac may synchronize the source and the backup directory i.e.
   it modifies backup directory ( deletes files, delete directories,
   make new directories and, of course, copies files ) in such a way
   that the backup directory ends up identical to the source directory.

   It may compare each file after it is copied to make sure the backup is
   correct.

   Before copying starts, it may verify the presence of a specified
   file or directory on the target directory.  By doing so, 
   you can check that the appropriate backup disk has been put in
   when the backup directory is located on an external disk.

   TreeBac may include or exclude any pattern of files.

   It may compress or decompress each file as it is being copied.

   It may log results in a file on disk.

   Its many options facilitate its use as a backup program in DOS.

   It is year 2000 ready !

Installation

   Copy the executable ( TREEBAC.EXE ) in one of the directories that
   your DOS PATH points to.  This is to make sure that TREEBAC will
   execute from any directories.  You may already have a directory,
   C:\UTIL for instance, containing some other DOS utilities; this 
   is a good place to copy TREEBAC.EXE .

Syntax     TREEBAC [ /INFO ]
           TREEBAC   source_dir           target_dir         [ options ]
           TREEBAC { d:\source | *.* }  { d:\target | *.* }  [ options ]

Quick help

   TREEBAC without argument displays a quick help screen.

Quick info

   TREEBAC /INFO displays information on registration.

Arguments

  source_dir

   Source directory.
   The input is transformed into its canonical form.

   Let's say, for instance, that the current directory is c:\dos.
   If you specify c: as source directory, you really get c:\dos and
   not the root directory.  In this situation, .. would mean the
   root directory.  Of course, c:\ always means the root whatever
   the current directory is.

   "*.*" is treated here as a special case and it is replaced by the
   canonical form of the current directory.
                  
   Note : The program will not copy itself (TREEBAC.EXE) properly
          while it is running.
   There are two ways to overcome this, if it really is a problem :

   1) Make a copy of this program with another copy utility.
      Since no backup is needed, the program skips through this file.
   2) Run TREEBAC from the directory pointed to by your TEMP environmental
      variable.  This directory is avoided by TREEBAC and is never copied.
      See the note following the explanation for the /L switch.

  target_dir

   Target directory.

   Just take care that the source and the target directory trees
   do not overlap.  For instance, TREEBAC k:\ k:\tryit might lead to
   unpredictable results.

  options

   Options may begin with / or -.
   The order in which the option switches appears and the case of the
   option switches are not relevant.

   As a safety measure, when no options are specified, TreeBac does not
   try to synchronize perfectly the source and the backup directories :

   (1) Files and directories are not deleted on the target.
       (/D and /DELDIR option switch)

   (2) Directories are not created on the target. (/M option switch)

   You may use the fact that, by default, no new directories are created
   on the target to choose precisely which directories will be copied.
   Create yourself, on the target, the directory structure that will be
   backup up.

  options to synchronize source and target directories

   TreeBac may synchronize the source and the backup directory i.e.
   it modifies backup directory ( deletes files, delete directories,
   make new directories ) in such a way that the backup directory is
   identical to the source directory.

   For that purpose, you must use the following options switches :

   **********     /D                     ***************

   'Delete' files that are present on target but either are absent from 
   the source or not specified for processing.
   Note that, by default, all files are specified for processing unless
   the option switches /I and-or /X are used.

   Deletion is performed before copying in case target is low on free space.

   **********     /DELDIR or /DELDIR-    ***************

   'Delete' directories that present on target but absent on source 
   directory.
   The [-] means : DO NOT ASK user, just delete.
   If [-] is NOT used, user is asked for approbation to delete
   each directory or sub-directory.

   Deletion is performed before copying in case target is low on free space.
   I recommend you use /DELDIR- with care.

   **********     /M or /M+              ***************

   'Make' absent directories on backup.
   The [+] means : ASK user before making each new directory on
   the backup.

   If /M is not used and there is a directory on the source
   that is absent on the target, this directory is simply ignored.

   IMPORTANT NOTE : 

      Directories located at the first level are never created.
 
      For instance, if you use :   TREEBAC C:\BAT C:\ESSAI /M
      the directory C:\ESSAI will not be created if absent.
      As a safety measure, it is assumed that this directory must
      exist for the backup to proceed.

      On the other hand, directories located below C:\BAT will be
      created below C:\ESSAI if /M is used.

  options to make backup more secure

   **********     /W                     ***************

   'Warn' if copy doesn't occur and source is older than
   backup or source and backup differs in size.

   If this condition occurs, it normally requires the user attention, 
   so this option switch is recommended.

   - The source should never be older that backup unless the date 
     and time stamps have been modified or the backup has been modified 
     and maybe should now be regarded as the source.
   - If the source and backup file differs in size, it is most likely 
     because the backup disk is full.

   **********     /C                     ***************

   'Compare' after copy.
   Make sure everything is perfectly copied by comparing each copied file
   to source file.  This is performed on a file by file basis just
   after each file is copied.
   As each file is copied, a line indicating the source file and the 
   target directory is displayed on screen. When the comparison is good,
   the screen shows "ok" at the end of that line.
   If the /C option is not used "done" is displayed at the end of that
   line.

   If the switch /K is used to compress the file, the copied file is
   first decompressed in the directory that is pointed to by the TEMP
   variable. Then, the comparison takes place.

   **********     /Vfile or /V+file      ***************
   **********     /Vdir\ or /V+dir\      ***************

   'Verify' that a file or a directory (if this option ends with a \)
   exists on the target before TREEBAC proceeds.  When the backup directory
   is located on an external disk, you can check that the user has put in
   the appropriate backup disk.

   If [+] is used, TREEBAC asks to proceed anyway even if the check failed.
   The user may have put a blank disk to be use as the backup disk and,
   of course, no file or directory can be detected on that disk until
   the next time it is used.

  options to specify which files are copied

   **********     /DIRMINn               ***************

   In the specified source directory, only take into account directories
   at the first level of the tree with a 'Minute' stamp equal to 'n'.
   All other directories at the first level are ignored.
   Sub-directories that are below directories with a 'Minute' stamp equal
   to 'n' are NOT ignored.  This allows for selective backups of directories.

   The DIRDATE utility by Crystal Software Australia is useful to
   change dates on directories.
   It can be found at :         http://www.ozemail.com.au/~launch/

   For instance, I use DIRDATE to set all my directories located in
   the root directory with date stamps of 1, 2 or 3 minutes.
   TREEBAC is then used successively with the option /DIRMIN1, /DIRMIN2 or
   /DIRMIN3 to backup all my hard disk to a set of 3 LS-120 SuperDisks.
   This is very easy to manage.  Just make sure all the directories in the
   main root have their minute stamps set to 1, 2 or 3.
   Note : With this method, the root directory is backed up on all disks.

   **********     /If1,f2,...            ***************

   'Include' only files matching file specifications f1 or f2 or ...
   To shorten the command, /Ia[b[ is the same as /Ia*.*,b*.*
   Only files with these specifications are processed.

   **********     /Xf1,f2,...            ***************

   'eXclude' files matching file specifications f1 or f2 or ...
   To shorten the command, /Xa[b[ is the same as /Xa*.*,b*.*
   Exclude files with these specifications from process.

  options to compress files while copying

   **********     /K                     ***************

   'Compression' of copied files.
   Compression if performed on a file by file basis.

   **********     /KD                    ***************

   'Decompression' of copied files.
   Each file is decompressed as it is copied.
   Make sure you specify this option on a source directory containing
   file compressed with the /K option switch.

  options to control logging of results

   **********     /Q                    ***************

   'Quiet' mode.
   In the default mode, all files encountered are shown on screen.
   In the quiet mode, only copied files are shown on screen during
   the process.

   **********     /L                    ***************

   'Log' screen messages in a file on disk.
   The content of the file is affected by the /Q option switch.

   For long process, the user may leave and come back to browse
   this file to see what happened.

   This information is appended to file TREEBAC.LOG located in
   the directory specified by the environmental variable TEMP.  

   Note : The directory that is pointed to by TEMP is never copied.
          It is avoided by TREEBAC.  There is usually nothing that
          needs to be copied inside this directory and it allows the
          program to use it safely to log results in it.

  options useful in batch files

   **********     /Ssubdir              ***************

   'Subdirectory' to be added to d:\target.
   May be useful to specify which directory to copy from a batch file.
   This directory is added to the already specified target directory.
   For instance, TREEBAC C:\ D:\DATA\ /Sjanuary is equivalent to
   TREEBAC C:\ D:\DATA\january
   
   **********     /P or /Pmessage       ***************

   'Pauses' at the end of the process and displays a message.
   The default message is 'Press a key to continue ...'

Errorlevel

   Errorlevel is set on completion of the program and can be
   checked the usual way in a batch file.

   4 : Incorrect syntax or registration information requested - no work done.
   3 : Source or target directory absent - no work done.
   2 : User indicated that the backup disk is not the correct one.
   1 : Something is wrong.
   0 : Everything is O.K.

Examples

 1) TreeBac c:\ g:\ /c /d /deldir /l /w /m /q /xchklist.ms

    Backup partition c: to partition g:.
    Partition g: is a perfect copy of partition c: except for files
    chklist.ms which do not need to be copied.
    If partition g: is located on a second hard disk, this is quite
    a protection against equipment failure.

 2) TreeBac c:\ m:\ /C /D /DELDIR /L /W /M /Q /DIRMIN1 /V+dos\ /XCHKLIST.MS

    Backup a subset of partition c: to superdisk LS-120 m:.
    Only directories in root directory with a minute stamp of 1 are copied.
    Files chklist.ms are ignored.

 3) TreeBac c:\ g:\ /I*.exe,*.com,*.bat /Xa*.bat

    Backup c: to g:.
    All files : *.exe, *.com, *.bat
    Except    : a*.bat

Stop process

   As an emergency measure, if you need to stop the process, press
   Alt-C i.e. first press down the [Alt] key and press [C] at the same time.

How to contact the author

   If you have any questions or suggestions, my E-mail address is :
   ph@loginnovation.com

   You may send regular mail at the address indicated in the
   registration section below.

   I have set up a simple web site at http://www.logi.qc.ca/ph 
   where you will find the latest version of this utility.

   I also have another E-mail address.  This is not my main address 
   and I do not check my mail there very often but I have this permanent
   address in case I change my Internet Service Provider.
   So if, and only if ph@loginnovation.com is not in service anymore,
   use paul.huard@eudoramail.com

Registration

   This is a FULLY functional version of the program.
   You are allowed to try it freely until you know it fits your needs.
   If it does, please register.  
   The suggested fee is 7 $ U.S. or 10 $ CDN.

   Accepted methods of payment are :
   - checks in canadian or U.S. money drawn from canadian or U.S. banks
   - cash
   - international money order

   On reception of your registration fee, I will send you TREECMP by E-mail.
   TREECMP is the companion of TREEBAC.  It compares files instead of
   copying them.  TREECMP's documentation can be found in file TREECMP.TXT

   Please, complete the provided registration form REGISTER.TXT and
   send it to the following address :

   Claude Huard & associates inc.
   90, Tetreau St
   Sorel, QC, CANADA
   J3P 4S3
   Attention of : Paul Huard, eng.
   
Source code

   The source code is available to buy at the price of 20 dollars U.S.
   or 30 dollars canadian.  Please, complete the provided registration
   form REGISTER.TXT.

   This utility is written in pure Clipper 5.2 but the following
   third-party libraries have been used :

    The NANFORUM library.
     This excellent PUBLIC DOMAIN (free) library gives you the ability
     to call dos interrupts.
     The file nflib305.zip can be downloaded from :
     http://www.iag.net/~philb/ftplib.htm

     The functions Ft_Int86() and Ft_Peek() are needed
     for linking TREEBAC.

    The shareware compression library RcmpLib from Rolf van Gelder.
     If you buy the source code to be able to recompile and relink 
     the utility with the compression feature intact, this library is needed.
     However, the source code that is related to compression may be removed
     in a single operation by commenting out the first line of code i.e.
     #define COMPRESSION.

     You can download a demo of this excellent tool from :
     http://sibylle.tue.nl/~rcrolf/rvgcc/cccmp.html

     The functions R_CmpFile() and R_DCmpFile() are needed
     for linking TREEBAC when COMPRESSION is defined.

Responsability (the usual stuff)

   The author can not be help responsible for any loss of data or
   any other mishaps.

History

   There are no known bugs.

   Changes in version number only account for improvements made
   to the documentation.

