


RBAK(1)                   User Commands                   RBAK(1)


NAME
       rbak - read tapes written in Apollo wbak format

SYNOPSIS
       rbak [ -dev [device|[m|mt|ct|f][unit]] | -rem[ote]|-remct
       [user@]host:device | -from filename | -stdin ] [ -reten |
       -nreten ] [ -rewind ] [ -unload ] [ -f[ile] [fileno|cur] |
       -f[ile]id fileid ] [ -anys ] [ -reo ] [ -int | -index ] [
       -cr | -r | -ms | -md ] [ -pr pathname ...  ] [ -force ] [
       -du ] [ -l | -ld | -lf | -ll ] [ -sla | -nsla ] [ -dacl |
       -sacl ] [ -pdt ] [ pathname [ -as pathname ] ...  | -all ]

DESCRIPTION
       Rbak restores or lists objects from backup  media  written
       by wbak(1) on Apollo systems running Domain/OS.  This ver-
       sion of rbak runs on  non-Apollo  systems,  but  otherwise
       operates  in  exactly  the  same way as the Apollo version
       (except as noted below).  This allows rbak to be  used  to
       transfer information from Apollo to non-Apollo systems, or
       to read tapes that were written by wbak(1) when no  Apollo
       systems are available.

       The backup media can be specified using one of the follow-
       ing options:

       -dev [device|[m|mt|c|ct|f][unit]]
              Specifies the pathname of a standard  UNIX  device,
              or an Apollo device type and unit number, which are
              mapped into an appropriate UNIX device.  The Apollo
              device types recognized are m for reel-to-reel mag-
              netic tapes, mt for SCSI  magnetic  tapes,  c or ct 
              for cartridge tapes, or  f for floppy  disks.   The
              optional unit is an integer (if  the  unit  is  not
              specified,  it  defaults to 0).  If no backup media
              option is specified, then the default  -dev  m0  is
              assumed.   Note  that  floppy disk support for rbak
              (and wbak(1)) is limited.

       -rem[ote]|-remc|-remct [user@]host:device
              Allows the reading of wbak-format tapes mounted  on
              remote  tape  drives.   The optional user specifies
              the username on the remote system if different than
              the  local  username  (this is not supported by the
              Apollo version of rbak).  host specifies  the  name
              of  the  remote  system,  which  should  be running
              inetd(8) and able to accept an rcmd(3)  request  to
              start  rmt(8)  (for the non-Apollo version of rbak;
              the Apollo version uses rexec(3) instead).   device
              specifies  the  pathname of the tape drive attached
              to the remote system.  Note that  this  option  can
              only  be  used with tape drives, and not with other
              remote devices or files.
              Use -remc or -remct for remote cartridge tapes.

       -from filename
              Reads the backup  input  from  a  file  written  by
              wbak(1)  using  the  -to  or  -stdout options.  The
              filename specifies the pathname of the file.

       -stdin Specifies the backup input media to be the standard
              input.   This option is especially useful for read-
              ing data from pipes, and can also be used for read-
              ing files.

       Several  options can be used to specify special operations
       for tapes:

       -reten Retensions the  tape  (unwinds  to  the  end,  then
              rewinds).   This  can  be helpful with certain car-
              tridge tapes if tape  reading  errors  are  encoun-
              tered.   Retensioning  can  require  a  significant
              amount of time to complete, and is not supported on
              many systems (see mtio(7) for more details).  It is
              usually better to retension  tapes  as  a  separate
              operation  using  mt(1).  Using -reten with -remote
              is unlikely to work unless the remote system is the
              same type as the local system.

       -nreten
              Do not retension the tape.  This is the default.

       -rewind
              Rewind the tape after reading or indexing.  If this
              option is omitted, no explicit rewind operation  is
              performed,  but  certain  tape  devices  are always
              rewound when  closed  on  non-Apollo  systems  (see
              mtio(7) for more details).

       -unload
              Rewind  and unload the tape after reading or index-
              ing.

       Multiple wbak-format files can  be  written  to  a  single
       tape.   Each  file is preceded and followed by ANSI-format
       header records (see ansitape(5) for  more  details).   The
       following options select the file to be read:

       -f[ile] [fileno|cur]
              Reads  the  file  with the file number fileno.  The
              file numbers are assigned when the tapes are  writ-
              ten  by  wbak(1).  Files are numbered starting at 1
              for each tape.  If the file number is specified  as
              cur,  then  rbak begins reading at current position
              on the back up medium.  Because of the  ANSI-format
              header  records  that precede and follow each wbak-
              format file,  three tape files must be  skipped  if
              using  mt(1)  to  position  the tape for each wbak-
              format file.  For example, the commands

                   rbak -f 5 ...

              and

                   mt rew
                   mt fsf 12     # need to skip 3*(5-1) files
                   rbak -f cur ...

              are equivalent.  If the file is not  specified  (by
              file  number or file ID), then rbak prompts for the
              file number (either an integer or cur can  then  be
              specified).
	      Use  rbak -f cur  repeatedly to  sequentially index
	      multiple wbak files.

       -f[ile]id fileid
              Reads  the file with file ID fileid.  The file ID's
              are optionally assigned when the tapes are  written
              by wbak(1).  Not all files have assigned file ID's.

       -anys  Forces rbak to accept any  section  of  the  backup
              file.    This option is useful when the backup
              media volume containing the desired object(s) to be
              restored  or  indexed  is known, and allows rbak to
              start at any section of the backup file (ie, allows
              rbak to start reading any volume in a multi-tape
              backup set).

       -reo   Forces the previous volume to be reopened, and sup-
              presses  reading  of the backup media volume label.
              This option is ignored by non-Apollo rbak.

       Rbak operates in one of two modes:

       -int   Selects   interchange   mode.    Backup  files  are
              restored to disk.  This is the default action.

       -index Selects index mode.  Backup filenames are listed on
              standard  output;  no  information  is  restored to
              disk.

       In interchange mode, rbak operates in  one  of  four  file
       restoration modes:

       -cr    Specifies  create  mode.   Rbak  does  not  restore
              objects if their names already exist on  disk.   An
              error  message  is printed if a name exists on both
              disk and backup media,  and  the  restoration  then
              continues.   This  mode is the safest (because disk
              objects are never  deleted),  and  is  the  default
              action.

       -r     Specifies  replace mode.  Rbak deletes the existing
              disk object, and replaces it with the  object  read
              from backup media.  This mode can be extremely dan-
              gerous when  restoring  directories,  since  entire
              directories on the disk can be recursively deleted.

       -ms    Specifies merge-source  mode  (similar  to  replace
              mode).   If  an object already exists on disk, rbak
              deletes the disk version and  restores  the  backup
              media version (the source).  However, if the object
              is a directory,  rbak  merges  the  back  up  media
              directory's contents with the disk directory.  This
              mode is somewhat less dangerous than replace  mode;
              additional safety is provided by the -pr option.

       -md    Specifies merge-destination mode (similar to create
              mode).  If an object already exists  on  disk  (the
              destination),  rbak  does  not  restore  the backup
              media version, and (silently) retains the disk ver-
              sion.   However, if the object is a directory, rbak
              merges the backup media directory's  contents  with
              the  disk  directory.   This  mode is somewhat more
              dangerous than create mode.

       Several  additional  options  are  provided   to   control
       restoration of files in interchange mode:

       -pr pathname ...
              Preserves  the specified objects on the disk.  Mul-
              tiple pathnames and wildcarding (interpreted by the
              shell)  are  permitted.   If  the  objects exist on
              disk, they are not overwritten by backup media ver-
              sions.   This  option  must  be  used  with the -ms
              option, and must be specified last for  the  Apollo
              version  of  rbak  (the non-Apollo version does not
              impose this restriction; the -pr option and  subse-
              quent pathnames can appear anywhere in the argument
              list).

       -force Forces object deletion by  the  Apollo  version  of
              rbak  if the user has owner rights.  This option is
              ignored by the non-Apollo version of rbak.

       -du    Causes the Apollo version of rbak to delete objects
              when  unlocked.   If  the  object  to be deleted is
              locked when rbak is invoked, the  delete  operation
              is  performed  when  the  object is unlocked.  This
              option is ignored  by  the  non-Apollo  version  of
              rbak.

      Listing  of  restored  objects  in interchange mode can be
      controlled by the following options:

       -l     Writes all of the file, directory,  and  (symbolic)
              link names to the standard output.

       -ld    Writes  all directory names to the standard output.

       -lf    Writes all file names to the standard output.

       -ll    Writes all (symbolic) link names  to  the  standard
              output.

       The  display  of  the backup media file label (part of the
       ANSI-format header records preceding the first wbak-format
       file) is controlled by the following options:

       -sla   Displays  the  backup media file label on the stan-
              dard output.  This is the default action.

       -nsla  Does not display the backup media file label. This
              option also suppresses most of the label checking,
              and should be used if the labels appear to be corr-
              upt or contain data which does not pass the normal
              checks.

       Attributes  of  files  restored  in  interchange  mode are
       determined by the following options:

       -dacl  Causes the Apollo version of  rbak  to  assign  the
              destination  directory's  default  ACL  to  objects
              being restored, and the non-Apollo version  to  use
              the  rules  described  in  open(2) to determine the
              user ID, group ID,  and  file  protection  mode  of
              objects   being  restored.   This  is  the  default
              action.

       -sacl  Causes the Apollo version of  rbak  to  retain  the
              original  ACL  for  restored  objects, and the non-
              Apollo version to  retain  the  original  user  ID,
              group  ID,  and  file  protection mode for restored
              objects.  Normally only the  superuser  can  retain
              the  original  user  ID  and  group  ID of restored
              objects.

       -pdt   Preserves  the  original  access  and  modification
              times  for restored objects.  The default action is
              to set these times to the current time.

       The pathnames of the object(s) to be indexed  or  restored
       to  disk  are  specified on the command line (these can be
       interspersed among the options in  any  order).   Multiple
       pathnames are permitted; wildcarding, however, is not sup-
       ported.  The pathnames must be specified exactly as  writ-
       ten  by  wbak(1);  use  index  mode  to  list the names of
       objects on the backup media if in doubt.

       If a directory name is specified, it refers to all of  the
       files  and  (recursively) subdirectories contained in that
       directory; file names  and  link  names  refer  to  single
       objects.   Restored  objects are assigned the same name on
       the disk as written by wbak(1)  by  default;  a  different
       name can be assigned to each pathname with a following -as
       pathname option.

       The -all option can be  used  in  place  of  pathnames  to
       restore  all  objects from the backup media.  If neither a
       pathname nor -all is specified, then rbak prompts for con-
       firmation before assuming -all.

       Additional options for the non-Apollo version of rbak:

       -512   Selects 512-byte wbak data blocks (normally used
	      in conjunction with -from or -stdin).   Such files
	      will only exist if they have been copied from a wbak
	      cartridge tape (using dd or similar), as Apollo wbak
	      creates disk files with  8192-byte blocks.   This 
              option is automatically selected if the -dev ct or
              -remct options are specified.

       -nty   Do not attempt to convert Apollo typed files to Unix
              format.   The default operation is to attempt such
              conversions, which typically includes deleting the
              file headers (which are normally meaningful only to
              the Apollo type managers).

       -rc    Attempt to convert Apollo "rec" type files to Unix
              binary files.  This involves removing the 4-byte
              record length field from the start of each record.
              (This field is  normally  meaningful only to the 
              Apollo type managers).  Such a conversion will in
              most cases correctly restore files such as Fortran
              direct access files, and some text files stored on
              Apollo as variable length "rec" type files.
              This is the default action.

       -nrc   Suppress conversion of Apollo "rec" type files.

       -v     Like -l but adds additional information, including
              file type and size in bytes.  If repeated (-v -v)
              displays some debugging information (such as ANSI
              tape headers).

EXAMPLES
       rbak -f 1 fred/soup

              Read fred/soup from backup file 1 and restore it to
              disk.  fred/soup may be a directory, file, or link.

       rbak -f 1 fred/soup -as blurfl/noodle

              Restore  fred/soup and place it in blurfl/noodle on
              the disk.

       rbak src -from fred/bck_out.file

              Restore the directory src to disk.  Read the backup
              input from the file fred/bck_out.file, which should
              have  been  written by wbak(2) using either the -to
              or -stdout options.

       rbak -f 1 -dev ct -index -all
       rbak -f cur -dev ct -index -all

              List contents of the first and second wbak files on
              the tape loaded in the default cartridge tape drive.

AUTHOR
       non-Apollo version:

       Bob Byrnes
       301 Phillips Hall
       School of Electrical Engineering
       Cornell University
       Ithaca, NY 14853

       byrnes@ee.cornell.edu
       byrnes@crnlee.bitnet
       byrnes@deshaw.com


       Enhancements by:

       Russell Ayling
       rayling@rta.nsw.gov.au
       rba@rivernet.com.au


SEE ALSO
       wbak(1), mt(1), ansitape(1), rwmt(1)
       ansitape(5), mtio(7)
       rsh(1), rcmd(3), rexec(3), rmt(8)


NOTES

       Usage on SGI systems. 

       Use  -dev c5 to access the QIC drive at SCSI 5;
       use  -dev m4 to access the DAT drive at SCSI 4;
       use  -dev c for a QIC drive which is the only tape drive on
       the system (or is the default drive for that system).
       If -dev is omitted, rbak uses the default drive and assumes
       it is a DAT drive.

       Use -rem hostname:/dev/rmt/tps0d5nr for the DAT drive at 
       SCSI address 5 on the remote system;
       use -remct hostname:/dev/rmt/tps0d4nr for the QIC drive at 
       SCSI address 4 on the remote system;
       use -rem hostname:/dev/nrtape to access a remote DAT drive
       which is the only tape drive on the remote system (or is the
       default drive for that system);
       use -remct hostname:/dev/nrtape to access a remote QIC drive
       which is the only tape drive on the remote system (or is the
       default drive for that system).


BUGS
       Rbak cannot be expected to preserve Apollo-specific inter-
       nal  structure  when  restoring files onto non-Apollo sys-
       tems.  Special files (anything  other  than  plain  files,
       directories,  or  symbolic  links)  are  restored as plain
       files on non-Apollo systems (the  contents  are  typically
       not useful); this could be construed as a feature. (But see
       -nty, -cr, -ncr options).  Apollo "compress" type files are
       restored in a format that can be processed by uncompress(1) 
       (or gunzip), but they do not have a .Z suffix.

       Multi-volume support is provided, but sequence checking is
       rudimentary - if a volume is inserted out of sequence, rbak
       will abort with an "invalid sequence number" error.

       Remote cartridge tape operations may be unacceptably slow.

       It is most unlikely that this version of rbak will be able 
       to read floppy disks.
       



















































