Seth Woolley's Man Viewer

scpio(1) - scpio - copy file archives in and out (LEGACY) - man 1 scpio

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

SCPIO(1L)                   Schilys USER COMMANDS                   SCPIO(1L)



NAME
       scpio - copy file(1,n) archives in(1,8) and out (LEGACY)

SYNOPSIS
       scpio [ other options ] -o[aBcv]
       scpio [ other options ] -i[Bcdmruvf] [ pattern ...  ]
       scpio [ other options ] -it[Bcvf] [ pattern ...  ]
       scpio [ other options ] -p[adlmuv] directory

DESCRIPTION
       The scpio utility, depending on the options used:

             copies files to an archive file(1,n)

             extracts files from an archive file(1,n)

             lists files from an archive file(1,n)

             copies files from one directory tree to another.

OPTIONS
       The  scpio utility supports the XBD specification Utility Syntax Guide-
       lines. The cpio standard does not allow the option modifiers to be pre-
       sented as separate arguments from the option letters.  The scpio imple-
       mentation allows option modifiers to be presented as separate arguments
       from  the  option letters. When writing portable shell scripts do never
       make use of this feature.

       The following options are supported:

       -o     (Copy Out.) Read the standard input to obtain a  list  of  path-
              names  and  copy  those  files onto the standard output together
              with pathname and status information.  Output  is  padded  to  a
              512-byte boundary.

       -i     (Copy  In.)  Extract  files  from  the  standard input, which is
              assumed to be the product of a previous scpio  -o.   Only  files
              with names that match patterns are selected. The extracted files
              are conditionally created and copied into the current  directory
              tree  based upon the options described below. The permissions of
              the files will be those of the previous scpio -o.  The owner and
              group  of  the files will be that of the current user unless the
              user has appropriate privileges, which causes  scpio  to  retain
              the  owner  and group of the files of the previous scpio -o.  If
              the archive being read(2,n,1 builtins) does not match  the  modifier  specified,
              scpio may consider this to be an error(8,n) and exit(3,n,1 builtins) or may recognise
              the archive and continue processing. Only a user with  appropri-
              ate  privileges  can  extract block special or character special
              files from an archive.

       -it    (List.) List files from the archive. This is a sub mode  of  the
              copy in(1,8) mode, no files are created in(1,8) list mode.

       -p     (Pass.) Read the standard input to obtain a list of pathnames of
              files that are conditionally created and copied into the  desti-
              nation  directory tree based upon the option modifiers described
              below.

       The following option modifiers can be appended in(1,8) any sequence  to  the
       -o, -i or -p options:

       a      Reset  access(2,5)  times of input files after they have been copied.
              (When option l (see below) is also specified, the  access(2,5)  times
              of the linked files are not reset.)

       B      Block  input/output  5120 bytes to the record (does not apply to
              the -p option; meaningful only with data  directed  to  or  from
              character special files).

       d      Create directories as needed.

       c      Write or read(2,n,1 builtins) header information in(1,8) character form for portabil-
              ity.  Note that the Open Group standard does not specify the ar-
              chive  format  that  should be used with the c option.  For this
              reason it is questionable wether the c option  increases  porta-
              bility in(1,8) general.

              The archive format used by scpio with the c option is the format
              from the -H asc option.  It gives best cpio  compatibility  when
              transferring  files  to SVR4-based systems (except that the file(1,n)
              size is limited to 2 gigabytes).   When  transferring  files  in(1,8)
              cpio  archives to unknown operating systems, it is unwise to use
              the c option.

       r      Interactively rename(1,2,n) files. For  each  archive  member  matching
              pattern  operand, a prompt will be written to the file(1,n) /dev/tty(1,4).
              The prompt will contain the name of the archive member, but  the
              format  is  otherwise unspecified. A line will then be read(2,n,1 builtins) from
              /dev/tty(1,4).  If this line is blank, the  archive  member  will  be
              skipped.  If  this line consists of a single period, the archive
              member will be processed with no modification to its name.  Oth-
              erwise, its name will be replaced with the contents of the line.
              The scpio utility will immediately exit(3,n,1 builtins)  with  a  non-zero  exit(3,n,1 builtins)
              status if(3,n) end-of-file is encountered when reading a response, or
              if(3,n) /dev/tty(1,4) cannot be opened for reading and writing.

       t      Write a table of contents of the input. No files are created.

       u      Copy unconditionally (normally, an older file(1,n) will not replace a
              newer file(1,n) with the same name).

       v      Verbose:  print  the  names  of  the  affected files. With the t
              option, provides a detailed listing.

       l      Whenever possible, link(1,2) files rather than copying them.   Usable
              only  with the -p option.  The l option modifier is not yet sup-
              ported by scpio.


       m      Retain previous file(1,n) modification time. This option is  ineffec-
              tive on directories that are being copied.

       f      Copy in(1,8) all files except those in(1,8) patterns.


       The following other options are implemented as SVr4 compliant extension
       to the Open Group standard:


       -6     Extract UNIX System Sixth Edition cpio archives. This option  is
              not  valid in(1,8) archive create mode, it is mutually exclusive with
              -c, -H, and artype=.  As is is unclear  how  UNIX  System  Sixth
              Edition cpio archives look(1,8,3 Search::Dict) like, this option is currently unsup-
              ported.

       -@     Include extended file(1,n) attributes in(1,8) the archive.  This option is
              currently unsupported.

       -A     Append  files  to an existing archive.  The -A option only works
              together with the -O option.  See star(1,4) -r for more  information.

       -b     Reverses the order of the bytes within each word.  It is unclear
              what a word is supposed to be.  This option is  unsupported  but
              not needed as scpio includes automatic byte order recognition.

       -C #   Sets (input/output) archive block size to # bytes.

       -E name
              Read  filenames  for  store/create/list  command from name.  The
              file(1,n) name must contain a list of filenames, each on  a  separate
              line.

       -H header
              Set  the  archive type to header.  See star(1,4)(1) for more informa-
              tion.

       -I nm  Use nm as archive file(1,n) name instead of stdin.

       -k     Try to skip corrupt archive headers.

       -L     Follow symbolic links as if(3,n) they were files.

       -M message
              Define a message that is uses when switching media.  This option
              is currently unsupported.

       -O nm  Use nm as archive file(1,n) name instead of stdout.

       -P     Handle  Access  Control  List  (ACL)  information  in(1,8) create and
              extract mode.  See star(1,4) -acl for more information.

       -R nm  Reassign ownership and group for all files based  on  nm.   This
              option is currently unsupported.

       -s     Reverses the order of the bytes within each word.  It is unclear
              what a word is supposed to be.  This option is  unsupported  but
              not needed as scpio includes automatic byte order recognition.

       -S     Reverses  the  order  of  the halfwords within each word.  It is
              unclear what a word is supposed to be.  This  option  is  unsup-
              ported  but  not  needed  as scpio includes automatic byte order
              recognition.

       -V     Special verbose. Print a dot for each file(1,n) that is read(2,n,1 builtins) or writ-
              ten.  This option is currently unsupported.

       The  following  other  options are implemented as star(1,4) extension to the
       Open Group standard:

       -help  Prints a summary of the most important options for scpio(1)  and
              exits.

       -xhelp Prints  a summary of the less(1,3) important options for scpio(1) and
              exits.

       -version
              Prints the scpio version(1,3,5) number string(3,n) and exists.

       -/     Don't strip leading slashes from file(1,n) names when  extracting  an
              archive.  See star(1,4)(1) for more information.

       ..     Don't skip files that contain /../ in(1,8) the name.  See star(1,4)(1) for
              more information.

       -acl   Handle Access Control  List  (ACL)  information  in(1,8)  create  and
              extract mode.  See star(1,4)(1) for more information.

       artype=header
              Set  the  archive type to header.  See star(1,4)(1) for more informa-
              tion.

       -bz    Run the input or output through a bzip2 pipe(2,8)  -  see  option  -z
              below.  As  the  -bz  the  -z options are non standard, it makes
              sense to omit -bz options the inside shell scripts.  If you  are
              going  to  extract a compressed archive that is located inside a
              plain file(1,n), scpio will auto(5,8) detect compression  and  choose  the
              right decompression option to extract.

       bs=#   Set block size to #. You may use the same method as in(1,8) dd(1) and
              sdd(1).  See star(1,4)(1) for more information.

       -fifostats
              Print fifo statistics at the end of a scpio run  when  the  fifo
              has been in(1,8) effect.

       fs=#   Set fifo size to #.  See star(1,4)(1) for more information.

       -no-fifo
              Do  not  use  a  fifo  to  optimize data flow from/to tape.  See
              star(1,4)(1) for more information.

       -no-fsync
              Do not call fsync(2) for each file(1,n) that has been extracted  from
              the archive.  See star(1,4)(1) for more information.

       -no-statistics
              Do not print statistic messages at the end of a scpio run.

       -secure-links
              Do  not  extract  hard  links or symbolic links if(3,n) the link(1,2) name
              (the target of the link(1,2)) starts with a slash (/) or if(3,n)  /../  is
              contained in(1,8) the link(1,2) name.  See star(1,4)(1) for more information.

       -numeric
              Use the numeric user/group fields in(1,8) the listing rather than the
              default.  See star(1,4)(1) for more information.

       -time  Print timing info.  See star(1,4)(1) for more information.

       -xfflags
              Store and extract extended file(1,n) flags as found on BSD and  Linux
              systems.  See star(1,4) -acl for more information.

       -z     Run  the  input  or  output through a gzip pipe(2,8) - see option -bz
              above. As the -bz the -z options  are  non  standard,  it  makes
              sense  to omit -bz options the inside shell scripts.  If you are
              going to extract a compressed archive that is located  inside  a
              plain  file(1,n),  scpio  will auto(5,8) detect compression and choose the
              right decompression option to extract.


OPERANDS
       The following operands are supported:

       directory
              A pathname of an existing directory to be used as the target  of
              scpio -p.

       pattern
              Expressions making use of a pattern-matching notation similar to
              that used by the shell for filename pattern matching, and  simi-
              lar  to  regular  expressions.  The following metacharacters are
              defined:

              *      Matches any string(3,n), including the empty string.

              ?      Matches any single character.

              [...]  Matches any one of the enclosed  characters.  A  pair  of
                     characters  separated  by  `-' matches any symbol between
                     the pair (inclusive), as defined by  the  system  default
                     collating  sequence. If the first character following the
                     opening `[' is a `!', the results are unspecified.

              In pattern, the special characters "?", "*" and "["  also  match
              the  "/"  character.  Multiple cases of pattern can be specified
              and if(3,n) no pattern is specified, the default for pattern  is  "*"
              (that is, select(2,7,2 select_tut) all files).

              Note  that  scpio does not use fnmatch(3) based pattern matching
              as documented above, it rather uses the  pattern  matcher  docu-
              mented in(1,8) match(1).

STDIN
       When  the  -o or -p options are used, the standard input is a text file(1,n)
       containing a list of pathnames, one per line, to be copied.

       When the -i option is used, the standard input is an archive file(1,n)  for-
       matted  in(1,8)  any  way  that is understood by the archive handling engine
       (see -H help option for a complete list).

INPUT FILES
       The files identified by the pathnames in(1,8) the standard input are of  any
       type.

       When  the -r option is used, the file(1,n) /dev/tty(1,4) is used to write(1,2) prompts
       and read(2,n,1 builtins) responses.

ASYNCHRONOUS EVENTS
       Default.

STDOUT
       When the -o option is used, the standard output is an archive file(1,n) for-
       matted as specified by pax with the -x cpio option. For better compati-
       bility with SVR4-based systems that do not implement  the  cpio  format
       correctly,  scpio  by  default  limits  the length of file(1,n) names to 256
       bytes.  Use scpio -H cpio  to  explicitly  switch(1,n)  to  the  full  POSIX
       1003.1-1988 cpio archive format.

       Otherwise,  the  standard  output contains commentary in(1,8) an unspecified
       format concerning the progress of the execution.

STDERR
       When the -o option is not used, the standard error(8,n) contains  commentary
       in(1,8) an unspecified format concerning the progress of the execution. Oth-
       erwise, the standard error(8,n) is used only for diagnostic messages.

OUTPUT FILES
       Output files are created, as specified by the archive, when the  -i  or
       -p options are used.

EXTENDED DESCRIPTION
       None.


EXIT STATUS
       The following exit(3,n,1 builtins) values are returned:

       0      Successful completion.

       >0     An error(8,n) occurred.

CONSEQUENCES OF ERRORS
       If  a file(1,n) or directory cannot be created or overwritten, scpio contin-
       ues with the next file(1,n) in(1,8) the archive or file(1,n) to be added  to  the  ar-
       chive.


APPLICATION USAGE
       Archives  created  by scpio are portable between XSI-conformant systems
       provided the same procedures are used.

       The shell metacharacter notation is not fully compatible with that used
       by  the  shell  and the pax utility. Not all systems support the use of
       the negation character [! ...] in(1,8) cpio patterns. Portable  applications
       must avoid the use of this notation.

       For  portable  communication of data between XSI-conformant systems, it
       is recommended that only characters defined  in(1,8)  the  ISO/IEC  646:1991
       standard  International  Reference  Version (equivalent to ASCII) 7-bit
       range of characters be used and that only  characters  defined  in(1,8)  the
       Portable  Filename  Character Set be used for naming files. This recom-
       mendation is given because XSI-conformant systems support diverse code-
       sets  and  run  in(1,8)  various  geographical areas and there is no single,
       well-established codeset that incorporates all of the characters of the
       languages of the various geographical areas.

       The cpio archive format only supports file(1,n) sizes up to 8 gigabytes.

       Applications  should  migrate  to  the  pax archive format which is the
       POSIX 1003.1-2001 standard archive format and based on an extended  tar
       format.


FUTURE DIRECTIONS
       None.


EXAMPLES
       1. Copy the contents of a directory onto an archive:

       ls | scpio -o >../cpio.out

       2. Duplicate a directory hierarchy:

       cd olddir
       find . -depth -print | scpio -pd ../newdir


ENVIRONMENT
       The following environment variables may affect the execution of scpio:

       TZ     Determine the timezone used with date and time(1,2,n) strings.

SEE ALSO
       ar(1),  find(1),  sfind(1),  ls(1),  match(1), pax(1), spax(1), tar(1),
       star(1,4)(1).

DIAGNOSTICS
NOTES
       The default block size for cpio is 512 bytes,  this  slows  down  write(1,2)
       speed.  Use -B, -C, or bs= to set(7,n,1 builtins) a different block size.

       The  Open  Group, have given us permission to reprint portions of their
       documentation. In the following statement,  the  phrase  ``this  text''
       refers to portions of the system documentation.

       Portions  of  this text are reprinted and reproduced in(1,8) electronic form
       in(1,8) the scpio manual, from The Open Group Base Specifications  Issue  5,
       Copyright  (C)  1997 by The Open Group. In the event of any discrepancy
       between these versions and the original specification, the original The
       Open  Group Standard is the referee document. The original Standard can
       be obtained online at  http://www.opengroup.org/unix/single_unix_speci-
       fication_v2.

BUGS
AUTHOR
       Joerg Schilling
       Seestr. 110
       D-13353 Berlin
       Germany

       Mail bugs and suggestions to:

       schilling@fokus.fraunhofer.de       or       js@cs.tu-berlin.de      or
       joerg@schily.isdn.cs.tu-berlin.de



Joerg Schilling                    04/10/04                          SCPIO(1L)

References for this manual (incoming links)