Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ bru() — Amiga System V Release 4 Version 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought



          BRU(1)                   USER COMMANDS                     BRU(1)



          NAME
               bru - backup and restore utility

          SYNOPSIS
               bru modes [ control options ] [ selection options ] [  files
               ]

          DESCRIPTION
               Bru is a UNIX filesystem  backup  utility  with  significant
               enhancements  over  other more common utilities such as tar,
               cpio, volcopy, and dd.  Some of bru's capabilities include:

                    o  Full or incremental backup with quick and easy  res-
                       toration of files.
                    o  Multiple physical volumes per archive.
                    o  Data integrity assurance via checksum computation on
                       every archive block.
                    o  Ability to properly save  and  restore  directories,
                       symbolic  links,  block special files, and character
                       special files.
                    o  Comparison  of  archives  with   current   directory
                       hierarchy.
                    o  Ability to recover files from corrupted archives  or
                       damaged media with minimal data loss.
                    o  No inherent maximum archive buffer size.
                    o  Improved performance through random  access  archive
                       I/O when available.
                    o  Automatic byte or half word  swapping  as  necessary
                       when reading archives produced on other machines.
                    o  Recognition of filename generation patterns  in  the
                       same  form  as  the  shell  for  files  read from an
                       archive.
                    o  Intelligent handling of large, sparse files.

               When files are  specified  on  the  command  line  then  the
               actions  to  be  performed are limited to those files.  If a
               named file is a directory then it and  all  its  descendants
               are  used.   If  no files are specified then the default for
               writing archives is all  files  in  and  below  the  current
               directory.  The default for reading archives is selection of
               all files in the archive.

               If "-" is given instead of files then the standard input  is
               read to obtain the file list.  This is useful in conjunction
               with the find command to provide finer  control  over  files
               selected for backup.  Obviously this mode is only valid when
               bru is not also reading its archive from the standard input.

          DEFAULTS
               Various default parameters, such as archive device name  and
               size,  archive  buffer size, controlling terminal name, etc.
               are system dependent.  These defaults, along  with  version,



                                    Last change:                          1





          BRU(1)                   USER COMMANDS                     BRU(1)



               variant,  and  other miscellaneous internal  information may
               be discovered via the -h mode.

          MODES
               One or more of the following modes must be  specified.   The
               order  of  execution,  from  highest  priority to lowest, is
               ecitxdgh.

               -c        Create a new archive.  Forces a new archive to  be
                         created   regardless   of  whether  one  currently
                         exists.  Writing starts at the first block.

               -d        Differences between  archived  files  and  current
                         files are detected and reported.  May be specified
                         more than once, as -dd -ddd or  -dddd  to  control
                         level of difference checking.

                         When specified as -d bru reports when it discovers
                         that  a  regular file's size (st_size) or contents
                         (when compared as byte streams) has changed  since
                         the archive was made.

                         When  specified  as  -dd  bru  reports  additional
                         differences in modification date (st_mtime) access
                         mode (st_mode), number  of  links  (st_nlink)  for
                         non-directory  files,  differences in the contents
                         of symbolic links, owner id (st_uid), and group id
                         (st_gid).

                         When specified  as  -ddd  bru  reports  additional
                         differences  in  host device (st_dev), major/minor
                         device (st_rdev) for special files,  and  time  of
                         last access (st_atime) for regular files.

                         When specified as -dddd bru  reports  all  differ-
                         ences  except time of last status change (st_ctime
                         is not resettable), major/minor device numbers for
                         non-special  files (meaningless), and size differ-
                         ences  for  directory  files   (may   have   empty
                         entries).   The -dddd mode is generally only mean-
                         ingful during a verification pass with full  back-
                         ups of quiescent filesystems.

               -e        Estimate media requirements for  archive  creation
                         with  same  arguments.  Prints estimated number of
                         volumes, number of files  to  be  archived,  total
                         number  of  archive  blocks,  and  total  size  of
                         archive  in  kilobytes.   If  the  media  size  is
                         unknown or unspecified, it is assumed to be infin-
                         ite.

               -g        Dump archive info block  in  a  form  more  easily



                                    Last change:                          2





          BRU(1)                   USER COMMANDS                     BRU(1)



                         parsed   by   programs   implementing  a  complete
                         filesystem management package.  Performs no  other
                         archive actions.

               -h        Print help summary of options.  Also  prints  some
                         internal  information  such  as version number and
                         default values for archive pathname,  media  size,
                         archive buffer size, etc.

               -i        Inspect archive for internal consistency and  data
                         integrity.   When -vv option is also given, prints
                         information from archive header block.

               -t        List table of contents of archive.  When used with
                         the  -v  option  will give a verbose table of con-
                         tents in the same format as the "ls  -l"  command.
                         When  used  with the -vv option will also indicate
                         what files are linked to other  files,  and  where
                         symbolic links point to.

               -x        Extract named files from archive.  If an  archived
                         file  is extracted (see -u option) then the access
                         mode, device id (special files only),  owner  uid,
                         group  uid, access time, and modification time are
                         also restored.  If  the  -C  flag  is  given  (see
                         below),  then  the owner uid and group uid will be
                         changed to that of the current user.

                         Nonexistent   directories   are   recreated   from
                         archived  directories  if possible, otherwise they
                         are created  with  appropriate  defaults  for  the
                         current  user.   Extracted  or created directories
                         are initially empty.

          CONTROL OPTIONS
               Many of the control options are similar in function to their
               tar or cpio equivalents.

               Sizes are specified in bytes.  The scale factors M, k, or b,
               can  be  used to indicate multiplication by 2**20 (one Mega-
               byte), 1024, or 512 respectively.  Thus  "10k",  "20b",  and
               "10240" all specify the same number of bytes.

               -# str    Use string str as a control string for  the  built
                         in  debugging system.  This option provides infor-
                         mation about the internal workings of bru for  the
                         software  maintainer  or the merely curious.  Some
                         examples are given later.

               -a        Do not reset the access times of disk  files  that
                         have  been  read  while  performing other actions.
                         Bru used to restore the  access  and  modification



                                    Last change:                          3





          BRU(1)                   USER COMMANDS                     BRU(1)



                         times  of  disk  files  after  they had been read.
                         Resetting the times prevents defeat of the mechan-
                         ism  used  to  track  down and remove "dead" files
                         that haven't been accessed in any  meaningful  way
                         recently.   For  various reasons, this flag is now
                         permanently enabled, thus defeating the  preserva-
                         tion  of  the access time field in the stat struc-
                         ture.

               -A flags  Special machine dependent options for  the  Commo-
                         dore Amiga.  Current flags are:

                              c    clear file archived bit after processing
                              i    ignore file archived bit  for  selecting
                                   files
                              r    reject files that have archived bit set
                              s    set file archived bit after processing

               -b bsize  Use bsize as the archive input/output buffer size.
                         The minimum is the size of an archive block (2k or
                         2048 bytes)  and  the  maximum  is  determined  by
                         available  memory  and I/O device limitations.  If
                         bsize is not an even multiple of  2048  bytes,  it
                         will  be rounded up.  Normally this option is only
                         required with the -c mode since  bru  writes  this
                         information  in  the  archive  header  block.   If
                         specified, bsize overrides  any  existing  default
                         value  (generally  20k),  whether built in or read
                         from the archive header.

               -B        Useful in shell scripts where bru is  run  in  the
                         background  with no operator present.  Under these
                         conditions, bru simply terminates with appropriate
                         error  messages and status, rather than attempting
                         interaction with the terminal.

               -C        Change  the  owner  (chown)  and  group  of   each
                         extracted  file  to the owner uid and group gid of
                         the current user.  Normally, bru will restore  the
                         owner  and group to those recorded in the archive.
                         This flag causes bru to follow the system default,
                         with  extracted  files  having  the same owner and
                         group as the user  running  bru,  including  Root.
                         (Under  4.2 BSD,  the default group is that of the
                         directory in which the file is created.)

                         The -C option is  useful  with  archives  imported
                         from  other systems.  In general, it should not be
                         used by the operator or system administrator  when
                         restoring  saved files.  Use the -tv option to see
                         the  owner  and  group  of  files  stored  in  the
                         archive.



                                    Last change:                          4





          BRU(1)                   USER COMMANDS                     BRU(1)



               -D        Causes bru to use double buffering to the  archive
                         device  on systems that have System V style shared
                         memory.  Depending upon hardware constraints, dou-
                         ble   buffering   may  dramatically  increase  the
                         archive device I/O rate, but may adversely  affect
                         the error recovery algorithms.

               -f path   Use path  as  the  archive  file  instead  of  the
                         default.   If  the  path  is "-" then bru uses the
                         standard input for  archive  reading  or  standard
                         output for archive writing, as appropriate.

                         If multiple -f options are  given,  each  path  is
                         added  to  a  list  of files to cycle through each
                         time a volume change is required.  When the end of
                         the list is reached, bru automatically cycles back
                         to the first path and waits  for  confirmation  to
                         continue  the cycle again.  Any input other than a
                         carriage return will cause bru to  use  the  newly
                         entered  path  and  to  abort  the cycling for the
                         remainder of the current run.

               -F        Fast mode.  In fast  mode,  checksum  computations
                         and comparisons are disabled.  This mode is useful
                         when the output of one bru is piped to  the  input
                         of  another bru, or when the data integrity of the
                         archive transmission medium  is  essentially  per-
                         fect.   Archives  recorded  with fast mode enabled
                         must also be read with fast mode.  Also, be  aware
                         that  some  of the automatic features of bru, such
                         as automatic byte swapping, are not functional  in
                         fast mode.

               -I iopt   Set interaction option from iopt.  Current  recog-
                         nized values for iopt are:

                              q,fifo    write queries to fifo
                              r,fifo    read responses from fifo
                              l,file    write log info to file

                         The q and r options  are  useful  for  interacting
                         with  bru  when it has been run without a control-
                         ling terminal.  See the discussion  under  RUNNING
                         FROM CRON.

               -L str    Label the archive with the specified  string  str.
                         Str  is  limited  to  63 characters and is usually
                         some meaningful reminder pertaining to the archive
                         contents.

               -l        Ignore unresolved  links.   Normally  bru  reports
                         problems  with  unresolved links (both regular and



                                    Last change:                          5





          BRU(1)                   USER COMMANDS                     BRU(1)



                         symbolic links).  This option suppresses all  such
                         complaints.

               -m        Do not cross mounted file system boundaries during
                         expansion  of  explicitly named directories.  This
                         option applies only to directories named in files.
                         It  limits  selection  of directory descendants to
                         those located on the same filesystem as the expli-
                         citly  named  directory.   This  option  currently
                         applies only to the -c and -e modes.

               -N nbits  Use nbits as the number of bits for  LZW  compres-
                         sion  if  -Z is also specified.  The default is to
                         use 12 bits, which is also the minimum  allowable.
                         The  maximum allowable value is 16 bits.  Archives
                         created with more than 12 bits of compression  may
                         be  unreadable on smaller systems due to memory or
                         processor word length constraints.

               -p        Pass over files in archive by reading rather  than
                         seeking.   Normally  bru  will  use  random access
                         capabilities if  available.   This  option  forces
                         reading instead of seeks.

               -P flags  Pathname options that provide explicit control  of
                         expansion  of  directories, automatic archiving of
                         parent directories, etc.  Possible characters  for
                         flags are:

                              e    Disable automatic  expansion  of  expli-
                                   citly named directories.
                              E    Enable automatic expansion of explicitly
                                   named directories.
                              f    Disable filter  mode.   Builds  internal
                                   tree  of pathnames before doing anything
                                   with the pathnames from the input list.
                              F    Enable filter mode.  Each pathname  from
                                   the  input list is treated individually,
                                   and processing is done with  that  path-
                                   name  before  the next pathname is exam-
                                   ined.
                              p    Disable automatic  archiving  of  parent
                                   directories of explicitly named files or
                                   directories.
                              P    Enable  automatic  archiving  of  parent
                                   directories of explicitly named files or
                                   directories.

                         See the discussion under DIRECTORIES.

               -R        Remote files are to be excluded from the  archive.
                         If the system does not support remote filesystems,



                                    Last change:                          6





          BRU(1)                   USER COMMANDS                     BRU(1)



                         this option is ignored.

               -s msize  Use msize as the media size.  The effective  media
                         size  will be computed from msize since it must be
                         integral multiple of the input/output buffer  size
                         (see the -b option).  Normally this option is only
                         required with the -c mode since  bru  writes  this
                         information  in  the  archive  header  block.   If
                         specified, msize overrides  any  existing  default
                         value,  whether  built in or read from the archive
                         header.

               -S size   Enable options to  deal  more  intelligently  with
                         sparse  files  (files  with  lots  of null bytes).
                         When used in conjunction with the -c  mode,  turns
                         on  automatic  file compression for files that are
                         larger than the specified size.  When used in con-
                         junction  with  the -x mode, seeks will be used to
                         create blocks of null bytes in  the  output  file,
                         rather  than actually writing null bytes.  See the
                         discussion under SPARSE FILES.

               -v        Enable verbose mode.  May be specified  more  than
                         once,  as  -vv,  -vvv,  or -vvvv, to get even more
                         verbosity.

               -w        Wait for confirmation.  Bru will  print  the  file
                         name, the action to be taken, and wait for confir-
                         mation.  Any response beginning with  'y'  or  'Y'
                         will  cause  the action to complete.  Any response
                         beginning with 'g' or 'G' will cause the action to
                         complete  and  will reset the -w option so that no
                         further  confirmations  will  be  requested.   Any
                         other response will abort the action.

               -Z        Use LZW file compression.  This is not the default
                         because  not  all versions of bru know how to deal
                         with compressed files.  When the -v option is also
                         selected,  the  compression ratio for each file is
                         printed as a percentage.  When this flag  is  used
                         in  conjunction  with  the -t option on an archive
                         that contains compressed file, the actual  archive
                         file  sizes and names are printed, rather than the
                         original values before archiving.

                         A limited amount  of  backwards  compatibility  to
                         non-compression   versions  of  bru  is  provided.
                         Archives read by older  versions  will  appear  to
                         contain  files  that  were  precompressed prior to
                         archiving.  The public domain compress utility can
                         be  used  to decompress such files after dearchiv-
                         ing.



                                    Last change:                          7





          BRU(1)                   USER COMMANDS                     BRU(1)



                         Also see the -N option.

          FILE SELECTION OPTIONS
               The file selection options control which files are  selected
               for  processing.  Note that some options are only valid with
               specific modes.

               -n date   Select only files newer than date.   The  date  is
                         given in one of the forms:

                              DD-MMM-YY[,HH:MM:SS]   EX: 12-Mar-84,12:45:00
                              MM/DD/YY[,HH:MM:SS]    EX: 3/12/84
                              MMDDHHMM[YY]           EX: 0312124584
                              pathname               EX: /etc/lastfullbackup

                         The time of day  is  optional  in  the  first  two
                         forms.   If present, it is separated from the date
                         with a comma.

                         If date is really the pathname of a file, then the
                         modification  date  of  that  file  will  be  used
                         instead.  This is useful in automated backups when
                         a dummy file is "touched" to save the date of last
                         backup.

               -o user   Select only files owned  by  user.   User  may  be
                         specified in one of three ways:

                              o  As an ascii string corresponding to a user
                                 name in the password file.
                              o  As the pathname of a file  in  which  case
                                 the owner of that file is used.
                              o  As a numeric value (decimal).

               -u flags  When used in  conjunction  with  -x  mode,  causes
                         files  of  type  specified by flags to be uncondi-
                         tionally  selected  regardless   of   modification
                         times.   Normally  bru  will not overwrite (super-
                         sede) an existing file with an older archive  file
                         of  the same name.  Files which are not superseded
                         will give warnings if verbose mode level  2  (-vv)
                         or  higher  is  enabled.   Possible characters for
                         flags are:

                              a    select all files (same as specifying all
                                   flags)
                              b    select block special files
                              c    select character special files
                              d    select directories
                              l    select symbolic links
                              p    select fifos (named pipes)
                              f    select regular files (same as r)



                                    Last change:                          8





          BRU(1)                   USER COMMANDS                     BRU(1)



                              r    select regular files (same as f)

                         Selection of directories only implies  that  their
                         attributes  may be modified.  Existing directories
                         are never overwritten, this option  merely  allows
                         their attributes to be set back to some previously
                         existing state.

                         Selection of symbolic links only implies that  the
                         contents  of  the  link  will  be modified.  It is
                         currently  impossible  under  4.2 BSD  to   change
                         access  time,  modification time, or the file mode
                         of a symbolic link.

          EXAMPLES
               Create (-c) a new archive of  all  files  under  "/usr/src",
               writing  archive  to  file  (-f)  "/dev/rmt0" using multiple
               tapes with a maximum size (-s) of 30 megabytes per tape.

                    bru -c -f /dev/rmt0 -s 30M /usr/src

               Create (-c) a new archive on the default device in the first
               pass, archiving all files in and below the current directory
               which have been created or modified (-n)  since  3  P.M.  on
               14-Jan-84.   Then  do a second pass to verify that there are
               no differences (-d) between the archive and  current  files.
               Each file is listed (-v) as it is processed.

                    bru -cvd -n 14-Jan-84,15:00:00

               Archive all files owned  (-o)  by  user  "user1"  using  the
               default archive device.

                    find / -user user1 -print | bru -c -
                    bru -c -o user1 /

               Copy a directory hierarchy from "/usr/u1" to "/usr/u2".

                    (cd /usr/u1; bru -cf - ) | (cd /usr/u2; bru -xf -)

               Extract (-x) the regular file  "/usr/guest/myfile"  uncondi-
               tionally  (-ur)  from  an  archive  on file (-f) "/dev/rf0".
               Since the device size was recorded in the header  block,  it
               need  not  be  specified.  Note that option arguments do not
               need to be separated from their corresponding option flag by
               whitespace.

                    bru -x -ur -f/dev/rf0 ./usr/guest/myfile

               Extract (-x) all C source files in "/usr/src/cmd" that  have
               names  beginning with characters 'a' through 'm'.  Wait (-w)
               for confirmation before extracting each file.



                                    Last change:                          9





          BRU(1)                   USER COMMANDS                     BRU(1)



                    bru -xw '/usr/src/cmd/[a-m]*.c'

               Inspect (-i) a previously created  archive  on  the  default
               device, dumping the contents of the header block for inspec-
               tion (-vvv) and  verifying  internal  consistency  and  data
               integrity of the archive.

                    bru -ivvv

               Perform the same function as the last example except  enable
               various  features of the built in debugger (when linked in).
               The  debug  control  string  is  a  string   of   the   form
               "-#<opt1>:<opt2>:...",  where each option is either a single
               flag character or a  flag  character  followed  by  a  comma
               separated  list.   Available flag characters are: 'd' enable
               debugging for list of keywords, 'f' limit debugging to  list
               of  function  names,  'F'  print source file name, 'L' print
               source file line  numbers,  'n'  print  nesting  depth,  'o'
               redirect  output to listed file, 'p' print process name, 't'
               enable tracing.

                    bru -ivvv -#t
                    bru -ivvv -#d:t
                    bru -ivvv -#d,ar_io,verify:F:L
                    bru -ivvv -#d:f,ar_seek
                    bru -ivvv -#d:o,trace.out:t:p

               Back up the entire root filesystem without crossing  mounted
               (-m)  filesystem boundaries.  The archive will be written to
               file (-f) "/dev/rmt0" using an I/O buffer size (-b)  of  10k
               bytes.   A  record of all files processed will be written to
               file "brulogfile" for future reference.

                    cd /
                    bru -cvm -f /dev/rmt0 -b 10k >brulogfile

          DIAGNOSTICS
               Most diagnostics are reasonably informative. The most common
               have  to do with meaningless combinations of options, incom-
               patible options, hitting memory or device limits, unresolved
               file  links, trying to archive or restore something to which
               access is normally denied, or  problems  with  media  errors
               and/or archive corruption.

          DEVICE TABLE
               Bru contains an internal table of known  devices  and  their
               characteristics.   Bru  first looks for an environment vari-
               able BRUTAB, which contains the name of  dynamically  loaded
               file  if  it begins with a '/' character, or contains device
               descriptions if the first character is not '/'.  If there is
               no  BRUTAB  environment  variable,  the file /etc/brutab, is
               loaded.  If neither of the preceding is found,  an  internal



                                    Last change:                         10





          BRU(1)                   USER COMMANDS                     BRU(1)



               default description is loaded.

          SIGNAL HANDLING
               Bru  normally  catches  both  interrupt  (SIGINT)  and  quit
               (SIGQUIT).  When interrupt is caught during archive creation
               or extraction, bru completes its work on  the  current  file
               before  cleaning  up and exiting.  This is the normal way of
               aborting bru.  When a quit signal  is  caught  an  immediate
               exit is taken.

               Note that during file extraction, a quit  signal  may  leave
               the  last  file only partially extracted.  Similarly, a quit
               signal during archive writing may leave  the  archive  trun-
               cated.  When either interrupt or quit is caught at any other
               time an immediate exit is taken.

          ERROR RECOVERY
               When  properly  configured  for  a  given  software/hardware
               environment,  bru  can recover from most common errors.  For
               example, attempts to use  unformatted  media  are  detected,
               allowing  substitution of formatted media.  Random blocks in
               an  archive  can  be  deliberately  overwritten  (corrupted)
               without  affecting  bru's  ability  to recover data from the
               rest of the archive.  When I/O errors are detected,  retries
               are  performed  automatically.   Out  of order sequencing on
               multi-volume archive reads is detected, allowing replacement
               with the correct volume.

          DIRECTORIES
               There are two actions bru takes with respect to directories,
               that  make  creation and extraction of entire hierarchies of
               files more  convenient  and  complete.   These  actions  are
               automatic  archiving  of  parent  directories  and automatic
               expansion of explicitly named directories.

               Automatic archiving of parent directories  means  that  when
               bru  is given the complete pathname of a file to archive, it
               attempts to automatically archive all parent directory nodes
               necessary  to  fully  restore  the  specified  file.  During
               extraction, any required directories which  do  not  already
               exist  are  restored from the archive if possible, otherwise
               they are created with appropriate defaults for  the  current
               user.   When  bru reads it's list of files from the standard
               input, or when the  -Pp  option  is  given,  this  automatic
               archiving  of  parent  directory  nodes is suppressed.  Note
               also, that  when  creating  archives  with  additional  con-
               straints  on  the  selected  files  (such  as  use of the -n
               option), these parent directories may be excluded.

               Automatic expansion of explicitly  named  directories  means
               that  when  bru  is given an explicit file name that names a
               directory node, not only is that  directory  node  archived,



                                    Last change:                         11





          BRU(1)                   USER COMMANDS                     BRU(1)



               but  all  files  and  subdirectories  in  that directory are
               archived.  I.E., the entire file  hierarchy  rooted  in  the
               explicitly named directory is archived.  When bru reads it's
               list of files from the  standard  input,  or  when  the  -Pe
               option  is given, this automatic expansion of directories is
               suppressed.

               Note that incremental archives, archives  created  with  the
               -Pp  option,  or  archives created from a list of files sup-
               plied on the standard input stream, may not contain  all  of
               the  necessary  parent directories to replicate the original
               hierarchy and thus may result  in  creation  of  directories
               with  the  default  attributes when files are extracted from
               the archive.

               When bru reads the list of files  from  the  standard  input
               stream,  the  default  values  for the -P options are -PeFp,
               which turns off expansion of directories,  turns  on  filter
               mode,  and  turns  off  automatic archiving of parent direc-
               tories.  This allows bru to be conveniently used to  archive
               only filesystem nodes that are explicitly named on the input
               list.

               When files are explicitly  named on  the  command  line  (or
               default  to  '.'), the default values for the -P options are
               -PEfP, which turns on expansion of  directories,  turns  off
               filter  mode,  and  turns  on  automatic archiving of parent
               directories.  This is typically the most convenient behavior
               for arguments given on the command line.

          WILDCARDS
               When reading archives bru recognizes  file  name  generation
               patterns  in  the  same  format  as  the shell.  This allows
               greater flexibility in specifying  files  to  be  extracted,
               compared,  or  listed.  As a special extension to shell type
               expansion, the sense of the match is reversed  for  patterns
               that begin with '!'.

               Note that the patterns may have  to  be  quoted  to  prevent
               expansion  by  the  shell.  Also note that patterns are pro-
               cessed independently, without regard for any other  patterns
               that  may  or  may  not be present.  In particular, "/bin/a*
               /bin/b*"  is  equivalent  to  "/bin/[ab]*",  but   "/bin/!a*
               /bin/!b*" is equivalent to "/bin/*", not "/bin/![ab]*".

          BYTE/WORD SWAPPING
               While reading  archives  produced  on  other  machines,  bru
               automatically  attempts to perform byte and/or word swapping
               as necessary.

          REMOTE TAPE DRIVES
               On 4.2 BSD  systems,  and  System  V  systems  that  support



                                    Last change:                         12





          BRU(1)                   USER COMMANDS                     BRU(1)



               networking, bru allows the use of remote tape drives for the
               archive device (via the -f option).   A  remote  tape  drive
               file name has the form

                    system[.user]:/dev/???

               where system is the remote system, the optional user is  the
               login name to use on the remote system if different from the
               current user's login name, and /dev/??? is the tape drive to
               use  (1600 BPI or 800 BPI, raw or blocked, rewinding or non-
               rewinding, etc.).  In all cases,  the  user  must  have  the
               appropriate permissions on the remote system.  (See also the
               CAVEATS section, below.)

          RUNNING FROM CRON
               Sometimes it is convenient to run bru under conditions where
               there  is no controlling terminal.  This can be a problem if
               interaction is needed, such  as  when  switching  to  a  new
               volume.   As  an  example,  consider the case of running bru
               from cron, where the operator mounts a tape  before  leaving
               in  the evening, and bru writes the first volume in the mid-
               dle of the night.  When returning in the morning, the opera-
               tor  wants  to  be able to mount a second tape if necessary,
               and instruct bru to continue.

               If no interaction with the user is  required,  running  from
               cron  is no different than running directly from a terminal.
               However, when interaction is necessary there  are  basically
               two options; terminate, or find some way to communicate with
               the operator (or another program masquerading as the  opera-
               tor).   The  -B option provides for simple termination.  The
               -I options provide for communication with an operator.

               On systems that support fifos, a pair of fifos are  used  to
               send  requests  and  receive  replies.   Before running bru,
               create a pair of fifos with the commands:

                    mknod /dev/bru.q p
                    mknod /dev/bru.r p

               Then, add the arguments "-Iq,/dev/bru.q  -Ir,/dev/bru.r"  to
               the  desired bru command line which ultimately gets executed
               under cron.  The first time bru needs to communicate with an
               operator,  it  will open the two fifos, write a query to the
               bru.q fifo, and wait for a response from the bru.r fifo.   A
               simple program provided with bru, called brutalk can be used
               to read the query and send a reply:

                    brutalk </dev/bru.q >/dev/bru.r

               The brutalk program will continue to read queries  and  send
               replies  until  either  bru  exits,  or a control-D (EOF) is



                                    Last change:                         13





          BRU(1)                   USER COMMANDS                     BRU(1)



               typed at the terminal.

          EXIT CODES
               Bru always returns meaningful status as follows:

                    0    Normal exit, no errors or warnings.
                    1    Warnings (or interrupted).
                    2    Errors (or quit signal).

          SPARSE FILES
               With the UNIX filesystem, it is  possible  to  create  files
               which  take  up much less space in the filesystem than their
               size would indicate.  These files  are  generally  known  as
               sparse  files,  and  are  common  in  database or scientific
               applications.

               For example, it is perfectly acceptable to create  an  empty
               file,  seek to an offset 1Mb from the start of the file, and
               then write a single byte of data at that point, thus  creat-
               ing  a file one byte more than 1Mb in length, with the first
               1Mb being  null  bytes  that  are  not  actually  stored  in
               separately allocated blocks in the filesystem.

               Without using the -S option, bru  would  archive  this  file
               using  1Mb of archive space, and on extraction, would create
               a file that actually takes up 1Mb of space in  the  filesys-
               tem.

               With the -S option, bru  will  automatically  compress  this
               file  down  to  about 4Kb in the archive, and on extraction,
               will use seeks to recreate  the  sparse  file,  thus  saving
               about 1Mb of space in the filesystem.

               The -S option is not the default because not all systems  on
               which  bru  runs  can  support sparse files, and because the
               overhead of compressing all  files  larger  than  the  auto-
               compression threshold can be significant.

               Note that this option is also useful even when sparse  files
               are  not expected, since it can be used during archive crea-
               tion to selectively compress files larger than  a  specified
               size.  This is generally faster than compressing every file,
               while still saving considerable space in the archive,  since
               large  files  generally  tend  to compress better than small
               ones.

          SEE ALSO
               Under System V, see
               tar(1), cpio(1), volcopy(1M),  finc(1M),  frec(1M),  ff(1M),
               filesave(1M).

               Under 4.2 BSD, see



                                    Last change:                         14





          BRU(1)                   USER COMMANDS                     BRU(1)



               tar(1),  dd(1),   rsh(1),   rmt(8),   dump(8),   restore(8),
               rdump(8), rrestore(8).

          AUTHOR
               Fred Fish
               Ported from System  V  to  4.2 BSD  by  Arnold  Robbins,  at
               Georgia Tech

          UNIX SYSTEM INCOMPATIBILITIES
               Bru recognizes special file types that may be allowed on one
               type of UNIX system, but not on another.  For instance, on a
               4.2 BSD system, bru will extract fifos as plain files  (mode
               0666,  as  modified  by the umask), and issue an appropriate
               error message.  Usually, bru will issue two  messages.   The
               first message will be the more descriptive of the two.

               Under System V, when bru sees a symbolic link, it will check
               to  see  if  the  file  to be linked to exists, and is not a
               directory.  If so, it will attempt to make a hard link.   If
               the hard link fails, bru will issue a warning.

               Pyramid corporation conditional symbolic links are also sup-
               ported.   On  a  Pyramid,  they are restored properly.  On a
               4.2 BSD system, bru will attempt a  symbolic  link  for  the
               file given in the UCB universe.  Under System V, it will at-
               tempt a hard link for the file given  in  the  ATT  universe
               (with  the  same  constraints  as when attempting to restore
               regular symbolic links).

               Currently, the only different UNIX systems  that  bru  fully
               understands are System V, 4.2 BSD, and Pyramid's OSx.

          CAVEATS
               Pathnames are limited to 1023  characters  in  length.   For
               linked files, the limit applies to the combined total of the
               first link found and the link currently being processed,  if
               both of them exceed the previous 127 character maximum, oth-
               erwise the limit applies to the link with the longest  path-
               name.  When earlier versions with a 127 character limit read
               archives produced by the 1023 character version,  they  will
               see a truncated pathname with the prefix "brutmp/".

               Implementation differences complicate the algorithms for au-
               tomatic detection of end of file on devices.  The algorithms
               can be fooled, hence the -s option.

               Special files moved to a machine other than  their  original
               host  will generally be useless and possibly even dangerous.
               This goes double for symbolic links.

               When extracting files from archives, patterns used to  match
               directories may result in some unnecessary directories being



                                    Last change:                         15





          BRU(1)                   USER COMMANDS                     BRU(1)



               extracted.  For example, if the pattern is "a/*/c", and  the
               directory "a/b" is encountered in the archive, the directory
               file "a/b" will be extracted since it will  be  needed  when
               (and  if)  the  file "a/b/c" is encountered.  When in doubt,
               use the -w option.

               In order to be able to  efficiently  archive  needed  direc-
               tories,  bru builds an image of the directory tree for files
               using dynamically allocated memory.  Since there may  be  at
               most  5120 characters passed on the command line, it is very
               unlikely that bru will run out of memory while building  the
               tree  from command line arguments.  This is not true of file
               lists read from the standard input, particularly on machines
               with limited address space.

               Information about file linkages  is  also  kept  in  memory.
               Some linkages may be lost if memory is exhausted.

               Since bru is owned by root and runs  with  "set user id"  to
               allow  it  to create directories and special files, it makes
               every attempt to prevent normal users from archiving or  ex-
               tracting  files  they  would  normally  not  have access to.
               There may be loopholes.  Also note that anyone with physical
               or electronic access to an archive, and knowledge of the ar-
               chive structure, can recover any of its contents by  writing
               their own file extraction program.

               Directories which have filesystems mounted on them will  not
               be  properly  archived  until  the  filesystem is unmounted.
               This is not generally a problem.

               Explicitly naming both a directory and one  of  its  descen-
               dants will cause the descendant to be archived twice, unless
               they are on separate filesystems and the -m flag is used.

               Explicitly naming a file more than once is ineffective.

               When reading from the raw magnetic tape  file  (rmtxxx)  bru
               automatically  attempts  to  adjust  the  I/O buffer size to
               match that used to record the archive.  Under  certain  cir-
               cumstances it may fail and require help via the -b option.

               The 4.2 BSD remote magnetic tape  protocol,  rmt(8),  allows
               writing and reading of no more than 10K bytes, so -b10k must
               be specified when reading from or writing to a  remote  tape
               drive.  Also, using remote tape drives can be slow.









                                    Last change:                         16



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026