1SCPIO(1L)                   Schily´s USER COMMANDS                   SCPIO(1L)
2
3
4

NAME

6       scpio - copy file archives in and out (LEGACY)
7

SYNOPSIS

9       scpio [ other options ] -o[aBcv]
10       scpio [ other options ] -i[Bcdmruvf] [ pattern ...  ]
11       scpio [ other options ] -it[Bcvf] [ pattern ...  ]
12       scpio [ other options ] -p[adlmuv] directory
13

DESCRIPTION

15       The scpio utility, depending on the options used:
16
17       ·      copies files to an archive file
18
19       ·      extracts files from an archive file
20
21       ·      lists files from an archive file
22
23       ·      copies files from one directory tree to another.
24

OPTIONS

26       The  scpio utility supports the XBD specification Utility Syntax Guide‐
27       lines. The cpio standard does not allow the option modifiers to be pre‐
28       sented as separate arguments from the option letters.  The scpio imple‐
29       mentation allows option modifiers to be presented as separate arguments
30       from  the  option letters. When writing portable shell scripts do never
31       make use of this feature.
32
33       The following options are supported:
34
35       -o     (Copy Out.) Read the standard input to obtain a  list  of  path‐
36              names  and  copy  those  files onto the standard output together
37              with pathname and status information.  Output  is  padded  to  a
38              512-byte boundary.
39
40       -i     (Copy  In.)  Extract  files  from  the  standard input, which is
41              assumed to be the product of a previous scpio  -o.   Only  files
42              with names that match patterns are selected. The extracted files
43              are conditionally created and copied into the current  directory
44              tree  based upon the options described below. The permissions of
45              the files will be those of the previous scpio -o.  The owner and
46              group  of  the files will be that of the current user unless the
47              user has appropriate privileges, which causes  scpio  to  retain
48              the  owner  and group of the files of the previous scpio -o.  If
49              the archive being read does not match  the  modifier  specified,
50              scpio may consider this to be an error and exit or may recognise
51              the archive and continue processing. Only a user with  appropri‐
52              ate  privileges  can  extract block special or character special
53              files from an archive.
54
55       -it    (List.) List files from the archive. This is a sub mode  of  the
56              copy in mode, no files are created in list mode.
57
58       -p     (Pass.) Read the standard input to obtain a list of pathnames of
59              files that are conditionally created and copied into the  desti‐
60              nation  directory tree based upon the option modifiers described
61              below.
62
63       The following option modifiers can be appended in any sequence  to  the
64       -o, -i or -p options:
65
66       a      Reset  access  times of input files after they have been copied.
67              (When option l (see below) is also specified, the  access  times
68              of the linked files are not reset.)
69
70       B      Block  input/output  5120 bytes to the record (does not apply to
71              the -p option; meaningful only with data  directed  to  or  from
72              character special files).
73
74       d      Create directories as needed.
75
76       c      Write or read header information in character form for portabil‐
77              ity.  Note that the Open Group standard does not specify the ar‐
78              chive  format  that  should be used with the c option.  For this
79              reason it is questionable wether the c option  increases  porta‐
80              bility in general.
81
82              The archive format used by scpio with the c option is the format
83              from the -H asc option.  It gives best cpio  compatibility  when
84              transferring  files  to SVR4-based systems (except that the file
85              size is limited to 2 gigabytes).   When  transferring  files  in
86              cpio  archives to unknown operating systems, it is unwise to use
87              the c option.
88
89       r      Interactively rename files. For  each  archive  member  matching
90              pattern  operand, a prompt will be written to the file /dev/tty.
91              The prompt will contain the name of the archive member, but  the
92              format  is  otherwise unspecified. A line will then be read from
93              /dev/tty.  If this line is blank, the  archive  member  will  be
94              skipped.  If  this line consists of a single period, the archive
95              member will be processed with no modification to its name.  Oth‐
96              erwise, its name will be replaced with the contents of the line.
97              The scpio utility will immediately exit  with  a  non-zero  exit
98              status if end-of-file is encountered when reading a response, or
99              if /dev/tty cannot be opened for reading and writing.
100
101       t      Write a table of contents of the input. No files are created.
102
103       u      Copy unconditionally (normally, an older file will not replace a
104              newer file with the same name).
105
106       v      Verbose:  print  the  names  of  the  affected files. With the t
107              option, provides a detailed listing.
108
109       l      Whenever possible, link files rather than copying them.   Usable
110              only  with the -p option.  The l option modifier is not yet sup‐
111              ported by scpio.
112
113
114       m      Retain previous file modification time. This option is  ineffec‐
115              tive on directories that are being copied.
116
117       f      Copy in all files except those in patterns.
118
119
120       The following other options are implemented as SVr4 compliant extension
121       to the Open Group standard:
122
123       -6     Extract UNIX System Sixth Edition cpio archives. This option  is
124              not  valid in archive create mode, it is mutually exclusive with
125              -c, -H, and artype=.  As is is unclear  how  UNIX  System  Sixth
126              Edition cpio archives look like, this option is currently unsup‐
127              ported.
128
129       -@     Include extended file attributes in the archive.  This option is
130              currently unsupported.
131
132       -A     Append  files  to an existing archive.  The -A option only works
133              together with the -O option.  See star -r for more information.
134
135       -b     Reverses the order of the bytes within each word.  It is unclear
136              what  a  word is supposed to be.  This option is unsupported but
137              not needed as scpio includes automatic byte order recognition.
138
139       -C #   Sets (input/output) archive block size to # bytes.
140
141       -E name
142              Read filenames for store/create/list  command  from  name.   The
143              file  name  must contain a list of filenames, each on a separate
144              line.
145
146       -H header
147              Set the archive type to header.  See star(1) for  more  informa‐
148              tion.
149
150       -I nm  Use nm as archive file name instead of stdin.
151
152       -k     Try to skip corrupt archive headers.
153
154       -L     Follow symbolic links as if they were files.
155
156       -M message
157              Define a message that is uses when switching media.  This option
158              is currently unsupported.
159
160       -O nm  Use nm as archive file name instead of stdout.
161
162       -P     Handle Access Control  List  (ACL)  information  in  create  and
163              extract mode.  See star -acl for more information.
164
165       -R nm  Reassign  ownership  and  group for all files based on nm.  This
166              option is currently unsupported.
167
168       -s     Reverses the order of the bytes within each word.  It is unclear
169              what  a  word is supposed to be.  This option is unsupported but
170              not needed as scpio includes automatic byte order recognition.
171
172       -S     Reverses the order of the halfwords within  each  word.   It  is
173              unclear  what  a  word is supposed to be.  This option is unsup‐
174              ported but not needed as scpio  includes  automatic  byte  order
175              recognition.
176
177       -V     Special verbose. Print a dot for each file that is read or writ‐
178              ten.  This option is currently unsupported.
179
180       The following other options are implemented as star  extension  to  the
181       Open Group standard:
182
183       -help  Prints  a summary of the most important options for scpio(1) and
184              exits.
185
186       -xhelp Prints a summary of the less important options for scpio(1)  and
187              exits.
188
189       -version
190              Prints the scpio version number string and exists.
191
192       -/     Don't  strip  leading slashes from file names when extracting an
193              archive.  See star(1) for more information.
194
195       ..     Don't skip files that contain /../ in the name.  See star(1) for
196              more information.
197
198       -7z    run  the  input  or  output through a p7zip pipe - see option -z
199              below.
200
201              Note that the p7zip program currently does not operate on a pipe
202              but  on  a  /tmp  file  copy and thus limits the maximum archive
203              size.
204
205
206       -acl   Handle Access Control  List  (ACL)  information  in  create  and
207              extract mode.  See star(1) for more information.
208
209       artype=header
210              Set  the  archive type to header.  See star(1) for more informa‐
211              tion.
212
213       -lzo   Run the input or output through a lzop  pipe  -  see  option  -z
214              below.
215
216       -bz    Run  the  input  or  output through a bzip2 pipe - see option -z
217              below. As the -bz the -z options  are  non  standard,  it  makes
218              sense  to omit -bz options the inside shell scripts.  If you are
219              going to extract a compressed archive that is located  inside  a
220              plain  file,  scpio  will auto detect compression and choose the
221              right decompression option to extract.
222
223       bs=#   Set block size to #. You may use the same method as in dd(1) and
224              sdd(1).  See star(1) for more information.
225
226       -fifostats
227              Print  fifo  statistics  at the end of a scpio run when the fifo
228              has been in effect.
229
230       fs=#   Set fifo size to #.  See star(1) for more information.
231
232       -no-fifo
233              Do not use a fifo to  optimize  data  flow  from/to  tape.   See
234              star(1) for more information.
235
236       -no-fsync
237              Do  not call fsync(2) for each file that has been extracted from
238              the archive.  See star(1) for more information.
239
240       -do-fsync
241              Call fsync(2) for each file that has been extracted from the ar‐
242              chive.  See star(1) for more information.
243
244       -no-statistics
245              Do not print statistic messages at the end of a scpio run.
246
247       -secure-links
248              Do  not  extract  hard  links or symbolic links if the link name
249              (the target of the link) starts with a slash (/) or if  /../  is
250              contained in the link name.  See star(1) for more information.
251
252       -numeric
253              Use the numeric user/group fields in the listing rather than the
254              default.  See star(1) for more information.
255
256       -time  Print timing info.  See star(1) for more information.
257
258       -xfflags
259              Store and extract extended file flags as found on BSD and  Linux
260              systems.  See star -acl for more information.
261
262       -z     Run  the  input  or  output through a gzip pipe - see option -bz
263              above. As the -bz the -z options  are  non  standard,  it  makes
264              sense  to omit -bz options the inside shell scripts.  If you are
265              going to extract a compressed archive that is located  inside  a
266              plain  file,  scpio  will auto detect compression and choose the
267              right decompression option to extract.
268
269       -zstd  run the input or output through a zstd  pipe  -  see  option  -z
270              above.
271
272

OPERANDS

274       The following operands are supported:
275
276       directory
277              A  pathname of an existing directory to be used as the target of
278              scpio -p.
279
280       pattern
281              Expressions making use of a pattern-matching notation similar to
282              that  used by the shell for filename pattern matching, and simi‐
283              lar to regular expressions.  The  following  metacharacters  are
284              defined:
285
286              *      Matches any string, including the empty string.
287
288              ?      Matches any single character.
289
290              [...]  Matches  any  one  of  the enclosed characters. A pair of
291                     characters separated by `-' matches  any  symbol  between
292                     the  pair  (inclusive),  as defined by the system default
293                     collating sequence. If the first character following  the
294                     opening `[' is a `!', the results are unspecified.
295
296              In  pattern,  the special characters "?", "*" and "[" also match
297              the "/" character. Multiple cases of pattern  can  be  specified
298              and  if  no pattern is specified, the default for pattern is "*"
299              (that is, select all files).
300
301              Note that scpio does not use fnmatch(3) based  pattern  matching
302              as  documented  above,  it rather uses the pattern matcher docu‐
303              mented in match(1).
304

STDIN

306       When the -o or -p options are used, the standard input is a  text  file
307       containing a list of pathnames, one per line, to be copied.
308
309       When  the -i option is used, the standard input is an archive file for‐
310       matted in any way that is understood by  the  archive  handling  engine
311       (see -H help option for a complete list).
312

INPUT FILES

314       The  files identified by the pathnames in the standard input are of any
315       type.
316
317       When the -r option is used, the file /dev/tty is used to write  prompts
318       and read responses.
319

ASYNCHRONOUS EVENTS

321       Default.
322

STDOUT

324       When the -o option is used, the standard output is an archive file for‐
325       matted as specified by pax with the -x cpio option. For better compati‐
326       bility  with  SVR4-based  systems that do not implement the cpio format
327       correctly, scpio by default limits the length  of  file  names  to  256
328       bytes.   Use  scpio  -H  cpio  to  explicitly  switch to the full POSIX
329       1003.1-1988 cpio archive format.
330
331       Otherwise, the standard output contains commentary  in  an  unspecified
332       format concerning the progress of the execution.
333

STDERR

335       When  the -o option is not used, the standard error contains commentary
336       in an unspecified format concerning the progress of the execution. Oth‐
337       erwise, the standard error is used only for diagnostic messages.
338

OUTPUT FILES

340       Output  files  are created, as specified by the archive, when the -i or
341       -p options are used.
342

EXTENDED DESCRIPTION

344       None.
345
346

EXIT STATUS

348       The following exit values are returned:
349
350       0      Successful completion.
351
352       >0     An error occurred.
353

CONSEQUENCES OF ERRORS

355       If a file or directory cannot be created or overwritten, scpio  contin‐
356       ues  with  the  next file in the archive or file to be added to the ar‐
357       chive.
358
359

APPLICATION USAGE

361       Archives created by scpio are portable between  XSI-conformant  systems
362       provided the same procedures are used.
363
364       The shell metacharacter notation is not fully compatible with that used
365       by the shell and the pax utility. Not all systems support  the  use  of
366       the  negation character [! ...] in cpio patterns. Portable applications
367       must avoid the use of this notation.
368
369       For portable communication of data between XSI-conformant  systems,  it
370       is  recommended  that  only  characters defined in the ISO/IEC 646:1991
371       standard International Reference Version (equivalent  to  ASCII)  7-bit
372       range  of  characters  be  used and that only characters defined in the
373       Portable Filename Character Set be used for naming files.  This  recom‐
374       mendation is given because XSI-conformant systems support diverse code‐
375       sets and run in various geographical areas  and  there  is  no  single,
376       well-established codeset that incorporates all of the characters of the
377       languages of the various geographical areas.
378
379       The cpio archive format only supports file sizes up to 8 gigabytes.
380
381       Applications should migrate to the pax  archive  format  which  is  the
382       POSIX  1003.1-2001 standard archive format and based on an extended tar
383       format.
384
385

FUTURE DIRECTIONS

387       None.
388
389

EXAMPLES

391       1. Copy the contents of a directory onto an archive:
392
393       ls | scpio -o >../cpio.out
394
395       2. Duplicate a directory hierarchy:
396
397       cd olddir
398       find . -depth -print | scpio -pd ../newdir
399
400

ENVIRONMENT

402       The following environment variables may affect the execution of scpio:
403
404       TZ     Determine the timezone used with date and time strings.
405

SEE ALSO

407       ar(1), find(1), sfind(1), ls(1),  match(1),  pax(1),  spax(1),  tar(1),
408       star(1).
409

DIAGNOSTICS

NOTES

412       The  default  block  size  for cpio is 512 bytes, this slows down write
413       speed.  Use -B, -C, or bs= to set a different block size.
414
415       Scpio  -iu  is  equivalent   to   star   -xU   -install   -force-remove
416       -remove-recursive  and  for  this  reason may remove nonempty directory
417       trees in extrace mode without printing a warning.
418
419       The Open Group, have given us permission to reprint portions  of  their
420       documentation.  In  the  following  statement, the phrase ``this text''
421       refers to portions of the system documentation.
422
423       Portions of this text are reprinted and reproduced in  electronic  form
424       in  the  scpio manual, from The Open Group Base Specifications Issue 5,
425       Copyright (C) 1997 by The Open Group. In the event of  any  discrepancy
426       between these versions and the original specification, the original The
427       Open Group Standard is the referee document. The original Standard  can
428       be  obtained online at http://www.opengroup.org/unix/single_unix_speci
429       fication_v2.
430

BUGS

AUTHOR

433       Joerg Schilling
434       Seestr. 110
435       D-13353 Berlin
436       Germany
437
438       Mail bugs and suggestions to:
439
440       joerg.schilling@fokus.fraunhofer.de or joerg@schily.net
441
442
443
444Joerg Schilling                   2019/01/05                         SCPIO(1L)
Impressum