home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 239.lha / doc / backup.doc < prev    next >
Text File  |  1989-05-02  |  14KB  |  387 lines

  1.  
  2.                    BACKUP.DOC
  3.  
  4.                  V2.02
  5.  
  6.                 16 November 1988
  7.      (c)Copyright 1988, Matthew Dillon, All Rights Reserved
  8.            Freely Distributable for non-profit only
  9.  
  10.  
  11.                   (I)
  12.                 OVERVIEW
  13.  
  14.     Backup and Restore (same executable, just renamed) allow you to backup
  15.     any directory tree with optional compression, and later extract all
  16.     or part of the tree.  The protection, date, and file comment is saved
  17.     with each file.
  18.  
  19.     SEE SECTION (6), FLOPICAL BACKUP, for options pertaining to backing
  20.     up directly to floppies.
  21.  
  22.     LIMITATIONS:    When using -c (compress), the entire result of the
  23.     compressed file must fit into memory.  Any files (after compression,
  24.     if any) larger than a floppy when backing up to floppies cannot be
  25.     handled yet.
  26.  
  27.  
  28.                   (I)
  29.                   INSTALLATION
  30.  
  31.     Copy the (1) executable to your C: directory twice, naming one
  32.     'Backup' and the other 'Restore'.  The program looks at the first
  33.     character of its name to determine whether the default is to backup
  34.     or restore.  If you don't have the space, all is not lost ... you
  35.     simply need to specify backup or restore explicitly with the options
  36.     (-b or -r).
  37.  
  38.                    (2)
  39.                  EXOTIC FEATURES
  40.  
  41.     Backup does not write directory trees which contain no files.  Thus,
  42.     when doing incremental backups on a large hard disk, the structure of
  43.     directory sub-trees which have no new files in them will not be
  44.     written.  So if you only modified a couple of files since the last
  45.     backup, there won't be 50K of structure-overhead.
  46.  
  47.     You can specify compression (-c) in the backup.  All files are
  48.     compressed (there must be enough RAM to hold the largest file in
  49.     its compressed state).  Those files which would turn out larger after
  50.     compression than before are NOT compressed.  Certain file suffixes
  51.     cause the compression attempt to be skipped entire:  .Z, .ARC, and .ZOO
  52.     files
  53.  
  54.       IT IS SUGGESTED YOU USE THE COMPRESSION FEATURE EVEN THOUGH IT
  55.       SLOWS DOWN THE BACKUP.  The resulting backup file will be
  56.       significantly reduced in size.  Even though a full backup will
  57.       take a long time, you only do that every once in a while and
  58.       as incremental backups are shorter, they take much less time.
  59.  
  60.     'Pick' patterns are supported (backup only paths which match the
  61.     specified patterns), and 'Discard' patterns are supported (do not backup
  62.     paths which match the specified patterns).    Discard patterns override
  63.     Pick patterns.
  64.  
  65.                   (3)
  66.                 OPTIONS
  67.  
  68.     Here is a list of Backup/Restore options.
  69.  
  70.     -0    (Restore) Causes all files to be restore to the current
  71.         directory (or -odirectory) rather than breaking them out
  72.         into a directory tree.
  73.  
  74.     -A    ARCHIVE.
  75.         (Backup) Causes the archive bit to be set on files
  76.         being backed up.
  77.  
  78.         (Restore):  If specified, the archive bit is cleared on
  79.         restored files.  Otherwise the archive bit will be set,
  80.         causing the files to be backed up again on the next
  81.         incremental backup.
  82.  
  83.     -U    UPDATE.  (Backup) Restricts the backup to only those files
  84.         which do not have the archive bit set.    Additionaly, the
  85.         structure of empty directory trees is not saved.
  86.  
  87.     -b    BACKUP    (this is the default if the first character in
  88.         the executable is a 'b')
  89.  
  90.     -r    RESTORE (this is the default if the first character in
  91.         the executable is an 'r')
  92.  
  93.     -a    APPEND (Backup)     Cause the backup to be appended to
  94.         the specified (-o) file rather than overwriting it.  Useful
  95.         for incremental backups.
  96.  
  97.     -c    COMPRESS (Backup)   Cause all files to be compressed, if
  98.         possible.  Restore automatically decompresses files which
  99.         have been compressed.  This is the same algorithm used
  100.         in the UNIX compress command.
  101.  
  102.         NO COMPRESSION WILL EVEN BE ATTEMPED ON FILES WITH THE
  103.         FOLLOWING SUFFIXES: .Z .ARC .ZOO
  104.  
  105.     -Cpat    Add the pattern to the list of patterns that are assumed
  106.         to be compressed already (so we don't waste time trying to
  107.         compress them if the -c option has been given
  108.  
  109.     -f[#kb] Turn on backup fragmentation and specify the fragment size,
  110.         default 800K (for backing up to floppies).  NOTE: Currently,
  111.         files larger than the fragment size cannot be backed up!
  112.  
  113.         Note: a suffix is added to the file name w/ a sequence
  114.         number, but each fragment is a complete backup file unto
  115.         itself and may be restored out of order.
  116.  
  117.         Any numerical value specified is in K, i.e. -f800 == 800K
  118.  
  119.         Note: prompting is enabled when one or more -F options
  120.         are given.  -f does not automatically enable prompting.
  121.  
  122.     -Fvol:    Add the volume (df0:, df1:, etc..) to the drive sequencing
  123.         list.  The idea is to specify several -F options which are
  124.         cycled through and prefix each fragment.  This also
  125.         enables prompting... the program prompts whenever it
  126.         switches to the next fragment.
  127.  
  128.         If -F is not specified at all and -f is, no prompting
  129.         occurs.
  130.  
  131.     -s    Only display directories as we go along
  132.  
  133.     -S    Silent... don't display files or directories
  134.  
  135.     -v    Verbose... display those files which will NOT be backed
  136.         up as well as those that will.
  137.  
  138.     -l/-t    (both do the same thing).  (Restore)   LIST the archive
  139.         only, do not do an actual restore.
  140.  
  141.     -T    (Restore)   Restore ONLY the timestamp, comment, and
  142.         protection fields.  This is incredibly useful to
  143.         restore timestamp information to files that already
  144.         exist.    NO files are overwritten or created on the
  145.         destination volume(s).
  146.  
  147.     -n#    (Backup)    Sets the output buffer size, in KILOBYTES.
  148.         Default is 64.
  149.  
  150.     -pPAT    (Backup)    Restrict the backup to files which match the
  151.         specified pattern.  Up to 32 patterns may be specified.
  152.  
  153.         (Restore)   Extract only those files which match the
  154.         specified pattern.
  155.  
  156.         NOTE:  The pattern is matched with the COMPLETE PATH as
  157.         shown in the -t option.  '*' and '?' wildcarding is supported
  158.  
  159.     -dPAT    (Backup)    Do not backup files which match the specified
  160.         pattern.   Up to 32 patterns may be specified.
  161.  
  162.         (Restore)   Do not extract files which match the specified
  163.         pattern.
  164.  
  165.         NOTE: The pattern is matched with the COMPLETE PATH as
  166.         shown in the -t option.  '*' and '?' wildcarding is supported.
  167.  
  168.     -oFILE    (Backup)    Specify the OUTPUT FILE for a backup.  IF NO
  169.         OUTPUT FILE IS SPECIFIED, NO OUTPUT FILE IS CREATED.  I.E.
  170.         you can take a second pass just to set the archive bit.
  171.  
  172.         (Restore)   Specify the directory to place the restored
  173.         directory tree.  (This overrides the volume the backup
  174.         was saved from).  If no directory specified, the original
  175.         volume used in the backup will be restored to.    If no
  176.         volume was specified in the backup but rather a relative
  177.         path was, the restore will be relative to the current
  178.         directory.
  179.  
  180.                   (4)
  181.               STANDARD METHOD OF BACKING UP
  182.  
  183.     Note that with combinations of -o, -A, and -U, you have many choices
  184.     available to you when backing up files.  For hard disks, backups are
  185.     normally done in two phases:
  186.  
  187.     -Once a month do a complete backup of your hard disk
  188.     -Every day do a much smaller 'incremental' backup which backs
  189.      up only those files which have been modified/created since the
  190.      last backup.
  191.  
  192.     The master backup, plus the N incremental backups together
  193.     reconstruct your disk up to the moment.  After a while the
  194.     number of incremental backups will be so great (and messy),
  195.     that you will want to do another complete backup and start
  196.     again.
  197.  
  198.     IN THIS WAY, the COMPRESS option can be put to good use.  The
  199.     incremental backups are usually small, and can be compressed
  200.     relatively quickly.  The complete backup should also be compressed
  201.     (-c in case you forgot) though this will take a much longer time...
  202.     but then again the complete backup is not done every day.
  203.  
  204.     UPDATING THE ARCHIVE BIT ON THE FLY VERSES TAKING A SECOND PASS.
  205.     Updating the archive bit involves writing to the disk.  For complete
  206.     safety you probably do NOT want to update the archive bit while you
  207.     are backing up the files in question.  The following two-pass method
  208.     works well:
  209.  
  210.         (COMPLETE BACKUP)
  211.  
  212.     backup    -c -d"*.o" volume: -ooutput
  213.     backup    -A volume:
  214.  
  215.         (INCREMENTAL BACKUP)
  216.  
  217.     backup -U -c -d"*.o" volume: -ooutput
  218.     backup -A volume:
  219.  
  220.     The -d option is saying "Don't backup all those object modules I left
  221.     laying around".
  222.  
  223.     The first command backs up only those files which have be modified
  224.     or created but does NOT update the archive bit.  The second command
  225.     updates the archive bit without doing anything else (no output file
  226.     is specified and thus none is created).  The second command goes
  227.     extremely quickly since files are not actually read.
  228.  
  229.     For your INCREMENTAL backups, risking modifying the archive bit while
  230.     backing the files up is feasible,  Since very few files will be
  231.     backed up (comparitively):
  232.  
  233.     backup -a -UA -c -d"*.o" volume: -ooutput
  234.  
  235.     In this case I use the -a option (append).  You might NOT want to do
  236.     this and save the incremental backups as separate files.
  237.  
  238.  
  239.                   (5)
  240.               STANDARD METHOD OF RESTORING
  241.  
  242.     Restoring a backup to the original volume: (Restore or Backup -r)
  243.  
  244.     NOTE:  If the -A option is specified, restored files will have
  245.     their Archive bit set.  If -A is NOT specified, files will have
  246.     their archive bit cleared and will thus be re-backed up on the next
  247.     incremental backup.
  248.  
  249.     NOTE:  When restoring files, remember that the incremental backups
  250.     will have the newest modifications and should be specified LAST:
  251.  
  252.     Restore completebkfile incr1 incr2 incr3....
  253.  
  254.     Partial Restore using -p:
  255.  
  256.     Restore -pstuffIWant bkfile1 bkfile2 bkfile3...
  257.  
  258.     ARCHIVE LISTING:
  259.  
  260.     Restore -t bkfile1 bkfile2....
  261.  
  262.     NOTE:    Two 'sizes' are given in the listing.  The first
  263.     is the # bytes the file takes up in the archive, the
  264.     second is the actual size of the file.
  265.  
  266.  
  267.                   (6)
  268.               FLOPICAL BACKUP AND RESTORE
  269.  
  270.     There are two problems associated with floppy backup and restore:
  271.  
  272.     (1) A single file on the HD may be two big for a single floppy
  273.     (2) It may take a lot of floppies to backup an HD
  274.  
  275.     Additionaly, one wants the following conveniences:
  276.  
  277.     (1) Be able to backup to a logical progression of (floppy) drives,
  278.     inserted blank disks in while the system is working on other
  279.     drives.
  280.  
  281.     (2) Be able to restore the same way
  282.  
  283.     (3) If one or more floppies is destroyed be able to restore from the
  284.     remaining floppies.
  285.  
  286.         Currently, you can specify which devices to cycle through
  287.         with the -F option (-Fdf0: -Fdf1: -Fdf2:), but BACKUP will
  288.         always prompt you before continuing.  Since it uses the
  289.         console device, you can specify the yes response as many
  290.         times as you have floppies in ready drives.
  291.  
  292.         Currently, files larger than the specified -f size (800K
  293.         default) cannot be handled if using -f/-F ... However, by
  294.         enabling compression larger files can still fit.
  295.  
  296.         Currently, the entire compressed result of a file must be
  297.         able to fit into memory during the backup.
  298.  
  299.  
  300.                    ***
  301.  
  302.     BACKUP.    Specify the -f option and then -Fvol: for each floppy
  303.     drive (in the order you want) to backup to.  Example:
  304.  
  305.     -f -Fdf0: -Fdf1:
  306.  
  307.     (Also keep in mind all the options listed in sections (3), (4), & (5))
  308.     Currently, you must have PRE-FORMATTED all your backup disks since the
  309.     backup/restore works through normal files.    The system will prompt for
  310.     readyness every time it completes a section.
  311.  
  312.     The backup process never deletes files, only creates or overwrites
  313.     them.  Thus, accidently sticking in a non-blank or incorrect backup
  314.     disk will probably result in a disk-full requester.... not Fatal, though
  315.     inconvenient.
  316.  
  317.     You must still specify the -o option to name the output file, which will
  318.     be prefixed with the next -F volume in sequence and suffixed with the
  319.     sequence number. (.nn)  The disk labels for your floppies may all be
  320.     the same.
  321.  
  322.     EXAMPLE:
  323.  
  324.     backup    -c -d"*.o" -f -Fdf0: -Fdf1: -Fdf2: volume: -oxxbak
  325.     backup    -A volume:
  326.  
  327.     NOTE:    You do NOT specifiy a volume prefix in the -o option ..
  328.     those specified by -F are automatically cycled through as the
  329.     prefix.
  330.  
  331.     * If your hard disk has enough space on it I suggest you backup to an
  332.       alternate partition using only -f (not -F which forces user prompts),
  333.       then copy the chunks to floppies after the entire backup has
  334.       completed.
  335.  
  336.                    ***
  337.  
  338.     RESTORE.    Restore works the same way.  EACH DISK IS INDEPENDANT!    You
  339.     may insert disks in any order to be restored.  Simply execute the
  340.     standard restore command in section (5) for each floppy.
  341.  
  342.     Destroyed disks may be skipped.  Currently, no support for partially
  343.     restored disks exists... i.e. the archive has to be clean.
  344.  
  345. V2.03:
  346.     Restore:    a file named the same as its parent directory didn't
  347.             get restored if restore had to create that parent
  348.             directory.    i.e. ram:etc/etc (the last etc being a file
  349.             name) would not get restored.
  350.  
  351.             Restore now properly restores things into the directory
  352.             specified by the -o option.  Before it would only do
  353.             that if a volume (blah:) was specified as the first
  354.             path segment.
  355.  
  356.             Restore now creates the directory specified by -o if
  357.             it does not already exist.    Also, lines like this:
  358.  
  359.             restore -oblah relative_path
  360.  
  361.             would fail w/ restore not being able to find the
  362.             relative path (it had already cd'd somewhere else).
  363.  
  364.     Backup:     Empty directory trees are now saved.  Before backup
  365.             would not save them.  However, if -U is specified
  366.             empty directory trees are not saved. (i.e. the master
  367.             backup has the whole directory structure while
  368.             incremental backups have only the structure pertaining
  369.             to newly saved files).
  370.  
  371.     -Cpat        New option, add pattern to list of patterns that will
  372.             no be compressed if -c is given.
  373.  
  374.     -0        (Restore): Causes all files to be restored to the
  375.             current (or -o) directory.
  376.  
  377. V2.02:
  378.     More minor bug fixes
  379.  
  380. V2.01:
  381.     Fixed bugs in restore (did not restore files into the proper
  382.     directories), and in backup (-a append flag did not work)
  383.  
  384. V2.00:
  385.     First release of V2
  386.  
  387.