1SCPIO(1L) Schily´s USER COMMANDS SCPIO(1L)
2
3
4
6 scpio - copy file archives in and out (LEGACY)
7
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
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
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 -no-statistics
241 Do not print statistic messages at the end of a scpio run.
242
243 -secure-links
244 Do not extract hard links or symbolic links if the link name
245 (the target of the link) starts with a slash (/) or if /../ is
246 contained in the link name. See star(1) for more information.
247
248 -numeric
249 Use the numeric user/group fields in the listing rather than the
250 default. See star(1) for more information.
251
252 -time Print timing info. See star(1) for more information.
253
254 -xfflags
255 Store and extract extended file flags as found on BSD and Linux
256 systems. See star -acl for more information.
257
258 -z Run the input or output through a gzip pipe - see option -bz
259 above. As the -bz the -z options are non standard, it makes
260 sense to omit -bz options the inside shell scripts. If you are
261 going to extract a compressed archive that is located inside a
262 plain file, scpio will auto detect compression and choose the
263 right decompression option to extract.
264
265
267 The following operands are supported:
268
269 directory
270 A pathname of an existing directory to be used as the target of
271 scpio -p.
272
273 pattern
274 Expressions making use of a pattern-matching notation similar to
275 that used by the shell for filename pattern matching, and simi‐
276 lar to regular expressions. The following metacharacters are
277 defined:
278
279 * Matches any string, including the empty string.
280
281 ? Matches any single character.
282
283 [...] Matches any one of the enclosed characters. A pair of
284 characters separated by `-' matches any symbol between
285 the pair (inclusive), as defined by the system default
286 collating sequence. If the first character following the
287 opening `[' is a `!', the results are unspecified.
288
289 In pattern, the special characters "?", "*" and "[" also match
290 the "/" character. Multiple cases of pattern can be specified
291 and if no pattern is specified, the default for pattern is "*"
292 (that is, select all files).
293
294 Note that scpio does not use fnmatch(3) based pattern matching
295 as documented above, it rather uses the pattern matcher docu‐
296 mented in match(1).
297
299 When the -o or -p options are used, the standard input is a text file
300 containing a list of pathnames, one per line, to be copied.
301
302 When the -i option is used, the standard input is an archive file for‐
303 matted in any way that is understood by the archive handling engine
304 (see -H help option for a complete list).
305
307 The files identified by the pathnames in the standard input are of any
308 type.
309
310 When the -r option is used, the file /dev/tty is used to write prompts
311 and read responses.
312
314 Default.
315
317 When the -o option is used, the standard output is an archive file for‐
318 matted as specified by pax with the -x cpio option. For better compati‐
319 bility with SVR4-based systems that do not implement the cpio format
320 correctly, scpio by default limits the length of file names to 256
321 bytes. Use scpio -H cpio to explicitly switch to the full POSIX
322 1003.1-1988 cpio archive format.
323
324 Otherwise, the standard output contains commentary in an unspecified
325 format concerning the progress of the execution.
326
328 When the -o option is not used, the standard error contains commentary
329 in an unspecified format concerning the progress of the execution. Oth‐
330 erwise, the standard error is used only for diagnostic messages.
331
333 Output files are created, as specified by the archive, when the -i or
334 -p options are used.
335
337 None.
338
339
341 The following exit values are returned:
342
343 0 Successful completion.
344
345 >0 An error occurred.
346
348 If a file or directory cannot be created or overwritten, scpio contin‐
349 ues with the next file in the archive or file to be added to the ar‐
350 chive.
351
352
354 Archives created by scpio are portable between XSI-conformant systems
355 provided the same procedures are used.
356
357 The shell metacharacter notation is not fully compatible with that used
358 by the shell and the pax utility. Not all systems support the use of
359 the negation character [! ...] in cpio patterns. Portable applications
360 must avoid the use of this notation.
361
362 For portable communication of data between XSI-conformant systems, it
363 is recommended that only characters defined in the ISO/IEC 646:1991
364 standard International Reference Version (equivalent to ASCII) 7-bit
365 range of characters be used and that only characters defined in the
366 Portable Filename Character Set be used for naming files. This recom‐
367 mendation is given because XSI-conformant systems support diverse code‐
368 sets and run in various geographical areas and there is no single,
369 well-established codeset that incorporates all of the characters of the
370 languages of the various geographical areas.
371
372 The cpio archive format only supports file sizes up to 8 gigabytes.
373
374 Applications should migrate to the pax archive format which is the
375 POSIX 1003.1-2001 standard archive format and based on an extended tar
376 format.
377
378
380 None.
381
382
384 1. Copy the contents of a directory onto an archive:
385
386 ls | scpio -o >../cpio.out
387
388 2. Duplicate a directory hierarchy:
389
390 cd olddir
391 find . -depth -print | scpio -pd ../newdir
392
393
395 The following environment variables may affect the execution of scpio:
396
397 TZ Determine the timezone used with date and time strings.
398
400 ar(1), find(1), sfind(1), ls(1), match(1), pax(1), spax(1), tar(1),
401 star(1).
402
405 The default block size for cpio is 512 bytes, this slows down write
406 speed. Use -B, -C, or bs= to set a different block size.
407
408 Scpio -iu is equivalent to star -xU -install -force-remove
409 -remove-recursive and for this reason may remove nonempty directory
410 trees in extrace mode without printing a warning.
411
412 The Open Group, have given us permission to reprint portions of their
413 documentation. In the following statement, the phrase ``this text''
414 refers to portions of the system documentation.
415
416 Portions of this text are reprinted and reproduced in electronic form
417 in the scpio manual, from The Open Group Base Specifications Issue 5,
418 Copyright (C) 1997 by The Open Group. In the event of any discrepancy
419 between these versions and the original specification, the original The
420 Open Group Standard is the referee document. The original Standard can
421 be obtained online at http://www.opengroup.org/unix/single_unix_speci‐
422 fication_v2.
423
426 Joerg Schilling
427 Seestr. 110
428 D-13353 Berlin
429 Germany
430
431 Mail bugs and suggestions to:
432
433 schilling@fokus.fraunhofer.de or js@cs.tu-berlin.de or
434 joerg@schily.isdn.cs.tu-berlin.de
435
436
437
438Joerg Schilling 07/06/03 SCPIO(1L)