afio.1 (afio-2.5.1.tgz) | : | afio.1 (afio-2.5.2.tgz) | ||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
With -o, reads pathnames from the standard input and writes an archive. | With -o, reads pathnames from the standard input and writes an archive. | |||
With -t, reads an archive and writes a table-of-contents to the standard output. | With -t, reads an archive and writes a table-of-contents to the standard output. | |||
With -i, installs the contents of an archive relative to the working dire ctory. | With -i, installs the contents of an archive relative to the working dire ctory. | |||
With -p, reads pathnames from the standard input and copies the files to each directory. Cannot be com- | With -p, reads pathnames from the standard input and copies the files to each directory. Cannot be com- | |||
bined with the -Z option. | bined with the -Z option. | |||
With -r, reads archive and verifies it against the filesystem. This i s useful for verifying tape ar- | With -r, reads archive and verifies it against the filesystem. This i s useful for verifying tape ar- | |||
chives. | chives, to ensure they have no bit errors. The verification compares fil | |||
e contents, but not permission | ||||
bits and non-file filesystem entities, so it cannot be used as a reliabl | ||||
e tool to detect every possible | ||||
change made to a filesystem. | ||||
Creates missing directories as necessary, with permissions to match their parents. | Creates missing directories as necessary, with permissions to match their parents. | |||
Removes leading slashes from pathnames, making all paths relative to the current directory. This is a | Removes leading slashes from pathnames, making all paths relative to the current directory. This is a | |||
safety feature to prevent inadvertent overwriting of system files when do ing restores. To suppress this | safety feature to prevent inadvertent overwriting of system files when do ing restores. To suppress this | |||
safety feature, the -A option must be used while writing an archive, but also when reading (installing), | safety feature, the -A option must be used while writing an archive, but also when reading (installing), | |||
verifying, and cataloging an existing archive. | verifying, and cataloging an existing archive. | |||
Supports compression while archiving, with the -Z option. Will compr ess individual files in the ar- | Supports compression while archiving, with the -Z option. Will compr ess individual files in the ar- | |||
chive, not the entire archive datastream, which makes afio compressed arc hives much more robust than | chive, not the entire archive datastream, which makes afio compressed arc hives much more robust than | |||
`tar zc' type archives. | `tar zc' type archives. | |||
Supports multi-volume archives during interactive operation (i.e., when /dev/tty is accessible and SIG- | Supports multi-volume archives during interactive operation (i.e., when /dev/tty is accessible and SIG- | |||
INT is not being ignored). | INT is not being ignored). | |||
ARCHIVE PORTABILITY | ||||
afio archives are portable between different types of UNIX systems, as th | ||||
ey contain only ASCII-formatted | ||||
header information. | ||||
Except in special cases discussed below, afio will create archives with t | ||||
he same format as ASCII cpio(1) | ||||
archives. Therefore cpio(1) can usually be used to restore an afio archi | ||||
ve in the case that afio is not | ||||
available on a system. (With most cpio versions, to unpack an ASCII forma | ||||
t archive, use cpio -c, and for | ||||
GNU cpio(1) use cpio -H odc.) When unpacking with cpio, any compressed f | ||||
iles inside an afio -Z archive | ||||
are not uncompressed by cpio, but will be created on the file syste | ||||
m as compressed files with a .z | ||||
extension. | ||||
Unfortunately, the ASCII cpio archive format cannot represent some files | ||||
and file properties that can be | ||||
present in a modern UNIX filesystem. If afio creates an archive with suc | ||||
h things, then it uses an afio- | ||||
specific 'large ASCII' header for the files concerned. Archives with la | ||||
rge ASCII headers cannot be | ||||
unpacked completely by cpio or afio versions before 2.4.8. | ||||
When creating an archive, the `large ASCII' header is used by afio to cov | ||||
er the following situations: | ||||
o A file has a size larger than 2 GB | ||||
o The archive contains more than 64K files which have hard links | ||||
o A file, directory, or special file has a UID or GID value larger th | ||||
an 65535. | ||||
The -5 option can be used to always preserve cpio compatibility, it will | ||||
cause afio to fail rather than | ||||
produce an incompatible archive in the cases above. | ||||
Archives made using the (deprecated) -4 option are also not compatible wi | ||||
th cpio, but they are compati- | ||||
ble with afio versions 2.4.4 and later. | ||||
ARCHIVE FILE FORMAT | ||||
An afio archive file has a simple format. The archive starts with a file | ||||
header for the first file, fol- | ||||
lowed by the contents of the first file (which will either be the exact c | ||||
ontents byte-for-byte, or the | ||||
exact contents in some compressed format). The data of the first file | ||||
is immediately followed by the | ||||
file header of the second file, and so on. At the end, there is a specia | ||||
l `end of archive' header, usu- | ||||
ally followed by some padding bytes. | ||||
A multi-volume afio archive is simply a normal archive split up into mu | ||||
ltiple parts. There are no spe- | ||||
cial volume-level data headers. This means that that volumes can be spli | ||||
t and merged by external pro- | ||||
grams, as long as the data stays in the correct order. It also implie | ||||
s that the contents of a single | ||||
file can cross volume boundaries. Selective restores of files at known v | ||||
olume locations can be done by | ||||
feeding only the needed volumes to afio, provided that the -k option is u | ||||
sed. | ||||
The contents of hard linked files are (unless the -l option is used) o | ||||
nly stored once in the archive. | ||||
The file headers for the second, third, and later occurence of a hard lin | ||||
ked file have no data after | ||||
them. This makes selective restores of hard-liked files difficult | ||||
: if later occurences are to be | ||||
restored correctly, the first occurence always needs to be selected too. | ||||
OPTIONS | OPTIONS | |||
-@ address Send email to address when a volume change (tape change, flo ppy change) is needed, and also | -@ address Send email to address when a volume change (tape change, flo ppy change) is needed, and also | |||
when the entire operation is complete. Uses sendmail(1) to send the mail. | when the entire operation is complete. Uses sendmail(1) to send the mail. | |||
-a Preserve the last access times (atimes) of the files read when making or verifying an ar- | -a Preserve the last access times (atimes) of the files read when making or verifying an ar- | |||
chive. Warning: if this option is used, afio will change t he last inode changed times | chive. Warning: if this option is used, afio will change t he last inode changed times | |||
(ctimes) of these files. Thus, this option cannot be us ed together with an incremental | (ctimes) of these files. Thus, this option cannot be us ed together with an incremental | |||
backup scheme that relies on the ctimes being preserved. | backup scheme that relies on the ctimes being preserved. | |||
-b size Read or write size-character archive blocks. Suffices of b, k, m and g denote multiples of | -b size Read or write size-character archive blocks. Suffices of b, k, m and g denote multiples of | |||
skipping to change at line 156 | skipping to change at line 110 | |||
-m Mark output files with a common current timestamp (rather th an with input file modification | -m Mark output files with a common current timestamp (rather th an with input file modification | |||
times). | times). | |||
-n Protect newer existing files (comparing file modification ti mes). | -n Protect newer existing files (comparing file modification ti mes). | |||
-s size Restrict each portion of a multi-volume archive to size cha racters. This option recognizes | -s size Restrict each portion of a multi-volume archive to size cha racters. This option recognizes | |||
the same size suffices as -b. Also, the suffix x denotes a multiple of the -b block size | the same size suffices as -b. Also, the suffix x denotes a multiple of the -b block size | |||
(and must follow any -b specification). size can be a si ngle size or a comma-seperated | (and must follow any -b specification). size can be a si ngle size or a comma-seperated | |||
list of sizes, for example '2m,5m,8m', to specify different sizes for the subsequent vol- | list of sizes, for example '2m,5m,8m', to specify different sizes for the subsequent vol- | |||
umes. If there are more volumes than sizes, the last specified size is used for all | umes. If there are more volumes than sizes, the last specified size is used for all | |||
remaining volumes. This option is useful with finite-length | remaining volumes. If this option is used, the special char | |||
devices which do not return | acter sequences %V and %S in | |||
short counts at end of media (sigh); output to magnetic tape | the input/output filename or command string are replaced b | |||
typically falls into this cat- | y the current volume number and | |||
egory. When an archive is being read or written, using -s | volume size. Use %% to produce a single % character. The - | |||
causes afio to prompt for the | s option is useful with finite- | |||
next volume if the specified volume length is reached. The | length devices which do not return short counts at end of m | |||
-s option will also cause afio | edia (sigh); output to magnetic | |||
to prompt if there is a premature EOF while reading the inpu | tape typically falls into this category. When an archive i | |||
t. The special case -s 0 will | s being read or written, using | |||
activate this prompting for the next volume on prematu | -s causes afio to prompt for the next volume if the spec | |||
re EOF without setting a volume | ified volume length is reached. | |||
length. When writing an archive, afio will prompt for the | The -s option will also cause afio to prompt if there is a p | |||
next volume on end-of-media, | remature EOF while reading the | |||
even without -s 0 being supplied, if the device is capable | input. The special case -s 0 will activate this prompting f | |||
of reporting end-of-media. If | or the next volume on premature | |||
the volume size specified is not a multiple of the block siz | EOF without setting a volume length. When writing an archiv | |||
e set with the -b option, then | e, afio will prompt for the | |||
afio(1) will silently round down the volume size to the near | next volume on end-of-media, even without -s 0 being suppli | |||
est multiple of the block size. | ed, if the device is capable of | |||
This rounding down can be suppressed using the -9 option: if | reporting end-of-media. If the volume size specified is not | |||
-9 is used, afio(1) will write | a multiple of the block size | |||
a small block of data, smaller than the -b size, at the | set with the -b option, then afio(1) will silently round do | |||
end of the volume to completely | wn the volume size to the near- | |||
fill it to the specified size. Some devices are not able | est multiple of the block size. This rounding down can be s | |||
to handle such small block | uppressed using the -9 option: | |||
writes. | if -9 is used, afio(1) will write a small block of data, s | |||
maller than the -b size, at the | ||||
end of the volume to completely fill it to the specified si | ||||
ze. Some devices are not able | ||||
to handle such small block writes. | ||||
-u Report files with unseen links. | -u Report files with unseen links. | |||
-v Verbose. Report pathnames (to stderr) as they are processed. When used with -t, gives an ls | -v Verbose. Report pathnames (to stderr) as they are processed. When used with -t, gives an ls | |||
-l style report (including link information) to stdout inste ad. When used twice (-vv) with | -l style report (including link information) to stdout inste ad. When used twice (-vv) with | |||
-o, gives an ls -l style report to stdout while writing th e archive. (But this use of -vv | -o, gives an ls -l style report to stdout while writing th e archive. (But this use of -vv | |||
will not work if the archive is also being written to stdout .) | will not work if the archive is also being written to stdout .) | |||
-w filename Treats each line in filename as an -y pattern, see -y. | -w filename Treats each line in filename as an -y pattern, see -y. | |||
skipping to change at line 256 | skipping to change at line 212 | |||
-G factor Specifies the gzip(1) compression speed factor, used whe n compressing files with the -Z | -G factor Specifies the gzip(1) compression speed factor, used whe n compressing files with the -Z | |||
option. Factor 1 is the fastest with least compression, 9 i s slowest with best compres- | option. Factor 1 is the fastest with least compression, 9 i s slowest with best compres- | |||
sion. The default value is 6. See also the gzip(1) m anual page. If you have a slow | sion. The default value is 6. See also the gzip(1) m anual page. If you have a slow | |||
machine or a fast backup medium, you may want to specify a l ow value for factor to speed up | machine or a fast backup medium, you may want to specify a l ow value for factor to speed up | |||
the backup. On large (>200k) files, -G 1 typically zips twi ce as fast as -G 6, while still | the backup. On large (>200k) files, -G 1 typically zips twi ce as fast as -G 6, while still | |||
achieving a better result than compress(1). The zip speed f or small files is mainly deter- | achieving a better result than compress(1). The zip speed f or small files is mainly deter- | |||
mined by the invocation time of gzip (1), see the -T option. | mined by the invocation time of gzip (1), see the -T option. | |||
-H promptscript | -H promptscript | |||
Specify a script to run, in stead of using the normal promp t, before advancing to the next | Specify a script to run, in stead of using the normal promp t, before advancing to the next | |||
achive volume. The script will be run with the volume numbe r, archive specification, and | archive volume. The script will be run with the volume numb er, archive specification, and | |||
the reason for changing to the next volume as arguments. Th e script should exit with 0 for | the reason for changing to the next volume as arguments. Th e script should exit with 0 for | |||
OK and 1 for abort, other exit codes will be treated as fata | OK and 1 for abort, other exit codes will be treated as fata | |||
l errors. afio executes the | l errors. As of afio version | |||
script by taking the promptscript string, appending the | 2.5.2, the promptscript can be a file name containing spaces | |||
arguments, and then calling the | or other special characters. | |||
shell to execute the resulting command line. This means t | ||||
hat a general-purpose prompt | ||||
script can be supplied with additional arguments, via the a | ||||
fio command line, by using a -H | ||||
option value like -H "generic_promptscript additional_arg_1 | ||||
additional_arg_2". | ||||
-J Try to continue after a media write error when doing a backu p (normal behavior is to abort | -J Try to continue after a media write error when doing a back up (normal behavior is to abort | |||
with a fatal error). | with a fatal error). | |||
-K Verify the output against what is in the memory copy of the disk (-F required). If the | -K Verify the output against what is in the memory copy of the disk (-F required). If the | |||
writing or verifying fails the following menu pops up | writing or verifying fails the following menu pops up | |||
[Writing/Verify] of disk [disk #] has FAILED! | [Writing/Verify] of disk [disk #] has FAILED! | |||
Enter 1 to RETRY this disk | Enter 1 to RETRY this disk | |||
Enter 2 to REFORMAT this disk before a RETRY | Enter 2 to REFORMAT this disk before a RETRY | |||
Enter quit to ABORT this backup | Enter quit to ABORT this backup | |||
Currently, afio will not process the answers 1 and 2 in the right way. The menu above is | Currently, afio will not process the answers 1 and 2 in th e right way. The menu above is | |||
only useful in that it signifies that something is wrong. | only useful in that it signifies that something is wrong. | |||
-L Log_file_path | -L Log_file_path | |||
Specify the name of the file to log errors and the final tot als to. | Specify the name of the file to log errors and the final tot als to. | |||
-M size Specifies the maximum amount of memory to use for the t | -M size Specifies the maximum amount of memory to use for the temp | |||
emporary storage of compression | orary storage of compression | |||
results when using the -Z option. The default is -M 250m (2 | results when using the -Z option. The default is -M 250 | |||
50 megabytes). If the com- | m (250 megabytes). If the com- | |||
pressed version of a file is larger than this (or if af | pressed version of a file is larger than this (or if afio r | |||
io runs out of virtual memory), | uns out of virtual memory), | |||
gzip(1) is run twice of the file, the first time to determin e the length of the result, the | gzip(1) is run twice of the file, the first time to determin e the length of the result, the | |||
second time to get the compressed data itself. | second time to get the compressed data itself. | |||
-P progname Use the program progname instead of the standard gzip(1) fo | -P progname Use the program progname instead of the standard gzip(1) for | |||
r compression and decompression | compression and decompression | |||
with the -Z option. For example, use the options -Z -P bzip2 | with the -Z option. For example, use the options -Z -P bzip | |||
to write and install archives | 2 to write and install archives | |||
using bzip2(1) compression. If progname does not have co | using bzip2(1) compression. If progname does not have comma | |||
mmand line options (-c, -d, and | nd line options (-c, -d, and | |||
-<number>) in the style of gzip(1) then the -Q option can b | -<number>) in the style of gzip(1) then the -Q option | |||
e used to supply the right | can be used to supply the right | |||
options. The compression program used must have the propert y that, if the output file size | options. The compression program used must have the propert y that, if the output file size | |||
exceeds the value of the -M option, then when the compressio | exceeds the value of the -M option, then when the compress | |||
n program is run for a second | ion program is run for a second | |||
time on the same input, it must produce an output with ex | time on the same input, it must produce an output with exact | |||
actly the same size. (See also | ly the same size. (See also | |||
the -M option description.) The GnuPG (gpg) encryption pr | the -M option description.) The GnuPG (gpg) encryptio | |||
ogram does not satisfy this | n program does not satisfy this | |||
lenght-preserving criterion unless its built-in compressi | lenght-preserving criterion unless its built-in compression | |||
on is disabled (see examples in | is disabled (see examples in | |||
the afio source script3/ directory). See also the -Q, -U an d -3 options. | the afio source script3/ directory). See also the -Q, -U an d -3 options. | |||
-Q opt Pass the option opt to the compression or decompression prog | -Q opt Pass the option opt to the compression or decompression p | |||
ram used with the -Z option. | rogram used with the -Z option. | |||
For passing multiple options, use -Q multiple times. If n | For passing multiple options, use -Q multiple times. If no | |||
o -Q flag is present, the stan- | -Q flag is present, the stan- | |||
dard options are passed. The standard options are -c -6 whe | dard options are passed. The standard options are -c -6 | |||
n the program is called for | when the program is called for | |||
compression and -c -d when the program is called for decom | compression and -c -d when the program is called for decompr | |||
pression. Use the special case | ession. Use the special case | |||
-Q "" if no options at all are to be passed to the program. | -Q "" if no options at all are to be passed to the program. | |||
-R Disk format command string | -R Disk format command string | |||
This is the command that is run when you enter 2 to reformat | This is the command that is run when you enter 2 to reform | |||
the disk after a failed ver- | at the disk after a failed ver- | |||
ify. The default (fdformat /dev/fd0H1440) can be changed | ify. The default (fdformat /dev/fd0H1440) can be changed to | |||
to a given system's default by | a given system's default by | |||
editing the Makefile. You are also prompted for formatting | editing the Makefile. You are also prompted for forma | |||
whenever a disk change is | tting whenever a disk change is | |||
requested. | requested. | |||
-S Do not ignore a leading slash in the pattern or the file na me when matching -y and -Y pat- | -S Do not ignore a leading slash in the pattern or the file nam e when matching -y and -Y pat- | |||
terns. See also -A. | terns. See also -A. | |||
-T threshold Only compress a file when using the -Z option if its length | -T threshold Only compress a file when using the -Z option if its len | |||
is at least threshold. The | gth is at least threshold. The | |||
default is -T 0k. This is useful if you have a slow m | default is -T 0k. This is useful if you have a slow machin | |||
achine or a fast backup medium. | e or a fast backup medium. | |||
Specifying -T 3k typically halves the number of invocations | Specifying -T 3k typically halves the number of invocati | |||
of gzip(1), saving some 30% | ons of gzip(1), saving some 30% | |||
computation time, while creating an archive that is only 5% | computation time, while creating an archive that is only 5% | |||
longer. The combination -T 8k | longer. The combination -T 8k | |||
-G 1 typically saves 70% computation time and gives a 20% si ze increase. The latter combi- | -G 1 typically saves 70% computation time and gives a 20% si ze increase. The latter combi- | |||
nation may be a good alternative to not using -Z at all. | nation may be a good alternative to not using -Z at all. Th | |||
These figures of course depend | ese figures of course depend | |||
heavily on the kind of files in the archive and the processo | heavily on the kind of files in the archive and the proc | |||
r - i/o speed ratio on your | essor - i/o speed ratio on your | |||
machine. See also the -2 option. | machine. See also the -2 option. | |||
-U If used with the -Z option, forces compressed versions to | -U If used with the -Z option, forces compressed versions to be | |||
be stored of all files, even if | stored of all files, even if | |||
the compressed versions are bigger than the original ve | the compressed versions are bigger than the original | |||
rsions, and disregarding any | versions, and disregarding any | |||
(default) values of the -T and -2 options. This is useful | (default) values of the -T and -2 options. This is useful w | |||
when the -P and -Q options are | hen the -P and -Q options are | |||
used to replace the compression program gzip with an encrypt ion program in order to make an | used to replace the compression program gzip with an encrypt ion program in order to make an | |||
archive with encrypted files. Due to internal limitations o f afio, use of this flag forces | archive with encrypted files. Due to internal limitations o f afio, use of this flag forces | |||
the writing of file content with each hard linked file, rath er than only once for every set | the writing of file content with each hard linked file, rath er than only once for every set | |||
of hard linked files. WARNING: use of the -U option will a | of hard linked files. WARNING: use of the -U option will al | |||
lso cause compression (or what- | so cause compression (or what- | |||
ever operation the -P option indicates) on files larger than | ever operation the -P option indicates) on files larger tha | |||
2 GB, if these are present in | n 2 GB, if these are present in | |||
the input. Not all compression programs might handle su | the input. Not all compression programs might handle such | |||
ch huge files correctly (recent | huge files correctly (recent | |||
Linux versions of gzip, bzip2, and gpg have all been tested | Linux versions of gzip, bzip2, and gpg have all been teste | |||
and seem to work OK). If your | d and seem to work OK). If your | |||
setup is obscure, some testing might be warranted. | setup is obscure, some testing might be warranted. | |||
-W filename Treats each line in filename as an -Y pattern, see -Y. | -W filename Treats each line in filename as an -Y pattern, see -Y. | |||
-Y pattern Do not process files whose names match shell wildcard patter n pattern. See also -y and -W. | -Y pattern Do not process files whose names match shell wildcard patter n pattern. See also -y and -W. | |||
-Z Compress the files that go into the archive when creating an archive, or uncompress them | -Z Compress the files that go into the archive when creating an archive, or uncompress them | |||
again when installing an archive. afio -Z will compress eac h file in the archive individu- | again when installing an archive. afio -Z will compress eac h file in the archive individu- | |||
ally, while keeping the archive headers uncompressed. Com | ally, while keeping the archive headers uncompressed. Compa | |||
pared to tar zc style archives, | red to tar zc style archives, | |||
afio -Z archives are therefore much more fault-tolerant agai | afio -Z archives are therefore much more fault-tolerant ag | |||
nst read errors on the backup | ainst read errors on the backup | |||
medium. When creating an archive with the -Z option, | medium. When creating an archive with the -Z option, afio | |||
afio will run gzip on each file | will run gzip on each file | |||
encountered, and, if the result is smaller than the original | encountered, and, if the result is smaller than the origina | |||
, store the compressed version | l, store the compressed version | |||
of the file. Requires gzip(1) to be in your path. Mainly t o speed up afio operation, com- | of the file. Requires gzip(1) to be in your path. Mainly t o speed up afio operation, com- | |||
pression is not attempted on a file if: 1) the file is very | pression is not attempted on a file if: 1) the file is ver | |||
small (see the -T option), 2) | y small (see the -T option), 2) | |||
the file is very large (see the -2 option), 3) the file | the file is very large (see the -2 option), 3) the file has | |||
has a certain extension, so it | a certain extension, so it | |||
probably contains compressed data already (see the -E option ), 4) the file pathname matches | probably contains compressed data already (see the -E option ), 4) the file pathname matches | |||
a certain pattern, as set by the -6 option, 5) the file | a certain pattern, as set by the -6 option, 5) the file has | |||
has hard links (this due to an | hard links (this due to an | |||
internal limitation of afio, but this limitation does not ap | internal limitation of afio, but this limitation does not | |||
ply if the -l option is also | apply if the -l option is also | |||
used). Regardless of the above, if the -U option is used | used). Regardless of the above, if the -U option is used th | |||
then the compression program is | en the compression program is | |||
always run, and the compressed result is always stored. Whe | always run, and the compressed result is always stored. | |||
n installing an archive with | When installing an archive with | |||
compressed files, the -Z option needs to be used in order to make afio automatically uncom- | compressed files, the -Z option needs to be used in order to make afio automatically uncom- | |||
press the files that it compressed earlier. The -P option c | press the files that it compressed earlier. The -P option | |||
an be used to do the (un)com- | can be used to do the (un)com- | |||
pression with programs other than gzip, see the -P (and -Q | pression with programs other than gzip, see the -P (and -Q a | |||
and -3) options in this manpage | nd -3) options in this manpage | |||
for details. See also the -G option which provides yet anot her way to tune the compression | for details. See also the -G option which provides yet anot her way to tune the compression | |||
process. | process. | |||
-0 Use filenames terminated with '\0' instead of '\n'. When us | -0 Use filenames terminated with '\0' instead of '\n'. When use | |||
ed as follows: find ... -print0 | d as follows: find ... -print0 | |||
| afio -o -0 ..., it ensures that any input filename can be | | afio -o -0 ..., it ensures that any input filename can be | |||
handled, even a file name con- | handled, even a file name con- | |||
taining newlines. When used as afio -t -0 ... | ..., th | taining newlines. When used as afio -t -0 ... | ..., this a | |||
is allows the table of contents | llows the table of contents | |||
output to be parsed unambiguosly even if the filenames conta | output to be parsed unambiguosly even if the filenames c | |||
in newlines. The -0 option | ontain newlines. The -0 option | |||
also affects the parsing of the files supplied by -w f | also affects the parsing of the files supplied by -w file a | |||
ile and -W file options: if the | nd -W file options: if the | |||
option -0 precedes them in the command line then the pattern | option -0 precedes them in the command line then the patte | |||
lines contained in the files | rn lines contained in the files | |||
should be terminated with '\0' in stead of '\n'. A secon | should be terminated with '\0' in stead of '\n'. A second u | |||
d use of -0 toggles the option. | se of -0 toggles the option. | |||
This can be useful when using multiple pattern files or when combining with the -t option. | This can be useful when using multiple pattern files or when combining with the -t option. | |||
-1 warnings-to-ignore | -1 warnings-to-ignore | |||
Control if afio(1) should exit with a nonzero code after pri nting certain warning messages, | Control if afio(1) should exit with a nonzero code after pri nting certain warning messages, | |||
and if certain warning messages should be printed at all. | and if certain warning messages should be printed at all. T | |||
This option is sometimes useful | his option is sometimes useful | |||
when calling afio(1) from inside a backup script or program. | when calling afio(1) from inside a backup script or pro | |||
afio(1) will exit with a | gram. afio(1) will exit with a | |||
nonzero code on encountering various 'hard' errors, and also (with the default value of the | nonzero code on encountering various 'hard' errors, and also (with the default value of the | |||
-1 option) when it has printed certain warning messages du ring execution. warnings-to- | -1 option) when it has printed certain warning messages during execution. warnings-to- | |||
ignore is a list of letters which determines the behavior re lated to warning messages. The | ignore is a list of letters which determines the behavior re lated to warning messages. The | |||
default value for this option is -1 mc. For afio versions 2 .4.3 and earlier, the default | default value for this option is -1 mc. For afio versions 2.4.3 and earlier, the default | |||
was -1 a. For afio versions 2.4.4 and 2.4.5, the default wa s -1 ''. The defined warnings- | was -1 a. For afio versions 2.4.4 and 2.4.5, the default wa s -1 ''. The defined warnings- | |||
to-ignore letters are as follows. a is for for ignoring all | to-ignore letters are as follows. a is for for ignoring al | |||
possible warnings on exit: if | l possible warnings on exit: if | |||
this letter is used, the printing of a warning message | this letter is used, the printing of a warning message will | |||
will never cause a nonzero exit | never cause a nonzero exit | |||
code. m is for ignoring in the exit code any warning about | code. m is for ignoring in the exit code any warning abo | |||
missing files, which will be | ut missing files, which will be | |||
printed when, on creating an archive, a file whose name was read from the standard input is | printed when, on creating an archive, a file whose name was read from the standard input is | |||
not found. c is for ignoring in the exit code the warning t | not found. c is for ignoring in the exit code the warning | |||
hat the archive being created | that the archive being created | |||
will not be not fully compatible with cpio or afio versions | will not be not fully compatible with cpio or afio versions | |||
2.4.7 or lower. C is the same | 2.4.7 or lower. C is the same | |||
as c, but in addition the warning message will not even be p | as c, but in addition the warning message will not even b | |||
rinted. M will suppress the | e printed. M will suppress the | |||
printing of all warning messages asssociated with Multivo | printing of all warning messages asssociated with Multivolum | |||
lume archive handling, messages | e archive handling, messages | |||
like "Output limit reached" and "Continuing". r is for igno | like "Output limit reached" and "Continuing". d is for igno | |||
ring certain warnings during | ring in the exit code any warn- | |||
the verify (-r) operation. If this letter is used, some ve | ings about changed files, which will be printed when, on cre | |||
rification errors that are very | ating an archive, a file that | |||
probably due to changes in the filesystem, during or after t | is being archived changes while it is being written into the | |||
he backup was made, are ignored | archive, where the changing is | |||
in determining the exit code. The two verification errors | detected by examining the file modification time stamp. r i | |||
that are ignored are: 1) a file | s for ignoring certain warnings | |||
in the archive is no longer present on the filesystem, and 2 | during the verify (-r) operation. If this letter is used | |||
) the file contents in the ar- | , some verification errors that | |||
chive and on the filesystem are different, but the file l | are very probably due to changes in the filesystem, during o | |||
engths or the file modification | r after the backup was made, | |||
times are also different, so the difference in contents is p | are ignored in determining the exit code. The two verif | |||
robably due to the file on the | ication errors that are ignored | |||
file system having been changed. n is for ignoring in the | are: 1) a file in the archive is no longer present on the fi | |||
exit code a particular class of | lesystem, and 2) the file con- | |||
no-such-file warnings: it ignores these warnings when they | tents in the archive and on the filesystem are different, b | |||
happen after the file has | ut the file lengths or the file | |||
already been succesfully opened. This unusual warning sit | modification times are also different, so the difference in | |||
uation can occur when archiving | contents is probably due to the | |||
files on Windows smbfs filesystems -- due to a Windows probl | file on the file system having been changed. s is for igno | |||
em, smbfs files with non-ASCII | ring in the exit code the warn- | |||
characters in their names can sometimes be opened but n | ing printed when the protection code (as described in the s | |||
ot read. When the -Z option is | ection about the -8 option) | |||
used, the n letter function is (currently) only implemented | rewrites a suspicious path name for a file or symlink th | |||
for files with sizes smaller | at is being unpacked. l is for | |||
than indicated by the -T option, so in that case the -T opti | ignoring in the exit code the warning printed when the -8 no | |||
on is also needed for this let- | symlinks option is used and a | |||
ter to have any effect. | symlink is encountered. n is for ignoring in the exit code | |||
a particular class of no-such- | ||||
file warnings: it ignores these warnings when they happen af | ||||
ter the file has already been | ||||
successfully opened. This unusual warning situation can occ | ||||
ur when archiving files on Win- | ||||
dows smbfs filesystems -- due to a Windows problem, smbfs fi | ||||
les with non-ASCII characters | ||||
in their names can sometimes be opened but not read. Wh | ||||
en the -Z option is used, the n | ||||
letter function is (currently) only implemented for files wi | ||||
th sizes smaller than indicated | ||||
by the -T option, so in that case the -T option is also nee | ||||
ded for this letter to have any | ||||
effect. | ||||
-2 maximum-file-size-to-compress | -2 maximum-file-size-to-compress | |||
Do not compress any files which are larger than this size wh en making a compressed archive | Do not compress any files which are larger than this size wh en making a compressed archive | |||
with the -Z option. The default value is -2 200m (200 Megab ytes). This maximum size cutoff | with the -Z option. The default value is -2 200m (200 Megab ytes). This maximum size cutoff | |||
lowers the risk that a major portion of a large file will be irrecoverable due to small | lowers the risk that a major portion of a large file will be irrecoverable due to small | |||
media errors. If a media error occurs while reading a file that afio has stored in a com- | media errors. If a media error occurs while reading a file that afio has stored in a com- | |||
pressed form, then afio and gzip will not be able to restore the entire remainder of that | pressed form, then afio and gzip will not be able to restore the entire remainder of that | |||
file. This is usually an acceptable risk for small files. H owever for very large files the | file. This is usually an acceptable risk for small files. H owever for very large files the | |||
risk of loosing a large amount of data because of this effec t will usually be too big. The | risk of loosing a large amount of data because of this effec t will usually be too big. The | |||
special case -2 0 eliminates any maximum size cutoff. | special case -2 0 eliminates any maximum size cutoff. | |||
-3 filedescriptor-nr | -3 filedescriptor-nr | |||
Rewind the filedescriptor before invoking the (un)comp ression program if using the -Z | Rewind the filedescriptor before invoking the (un)comp ression program if using the -Z | |||
option. This is useful when the -P and -Q options are used t o replace the compression pro- | option. This is useful when the -P and -Q options are used t o replace the compression pro- | |||
gram gzip with some types of encryption programs in order to make or read an archive with | gram gzip with some types of encryption programs in order to make or read an archive with | |||
encrypted files. The rewinding is needed to interface corre ctly with some encryption pro- | encrypted files. The rewinding is needed to interface corre ctly with some encryption pro- | |||
grams that read their key from an open filedescriptor. If the -P program name matches | grams that read their key from an open filedescriptor. If the -P program name matches | |||
'pgp' or 'gpg', then the -3 option must be used to avoid afi o(1) reporting an error. Use | 'pgp' or 'gpg', then the -3 option must be used to avoid afi o(1) reporting an error. Use | |||
the special case -3 0 to supress the error message without | the special case -3 0 to suppress the error message without | |||
rewinding any file descriptor. | rewinding any file descriptor. | |||
The -3 0 option may also be needed to sucessfully read back | The -3 0 option may also be needed to successfully read back | |||
encrypted archives made with | encrypted archives made with | |||
afio version 2.4.5 and older. | afio version 2.4.5 and older. | |||
-4 (Deprecated, the intended effect of this option is now ach ieved by default as long as the | -4 (Deprecated, the intended effect of this option is now arc hived by default as long as the | |||
-5 option is not used. This option could still be useful fo r compatibility with machines | -5 option is not used. This option could still be useful fo r compatibility with machines | |||
running an older version of afio.) Write archive with the `extended ASCII' format headers | running an older version of afio.) Write archive with the `extended ASCII' format headers | |||
which use 4-byte inode numbers. Archives using the extended ASCII format headers are not | which use 4-byte inode numbers. Archives using the extended ASCII format headers are not | |||
compatible with any other archiver. This option was u seful for reliably creating and | compatible with any other archiver. This option was u seful for reliably creating and | |||
restoring sets of files with many internal hard links, for e xample a news spool. | restoring sets of files with many internal hard links, for e xample a news spool. | |||
-5 Refuse to create an archive that is incompatible with cpio(1 ). If this option is used, | -5 Refuse to create an archive that is incompatible with cpio(1 ). If this option is used, | |||
afio will never write any `large ASCII' file headers that are incompatible with cpio(1), | afio will never write any `large ASCII' file headers that are incompatible with cpio(1), | |||
but fail with an error code instead. See the ARCHIVE PORTAB ILITY section above for more | but fail with an error code instead. See the ARCHIVE PORTAB ILITY section above for more | |||
information on the use of `large ASCII' file headers. | information on the use of `large ASCII' file headers. | |||
skipping to change at line 455 | skipping to change at line 415 | |||
If the -7 option is used in front of any option -y, -Y, -w, or -W, then the patterns sup- | If the -7 option is used in front of any option -y, -Y, -w, or -W, then the patterns sup- | |||
plied in these options are not intrerpreted as wildcard pat terns, but as character strings | plied in these options are not intrerpreted as wildcard pat terns, but as character strings | |||
that must match exactly to the file name, except possibly in leading slashes. This option | that must match exactly to the file name, except possibly in leading slashes. This option | |||
can be useful for handling the exceptional cases where fi le names in the archive, or the | can be useful for handling the exceptional cases where fi le names in the archive, or the | |||
names of files to be archived, contain wildcard characters t hemselves. For example, find | names of files to be archived, contain wildcard characters t hemselves. For example, find | |||
/tmp -print0 | afio -ov -Y '*.jpg' -7 -Y '/tmp/a[12]*4' -0 archive can be used to archive | /tmp -print0 | afio -ov -Y '*.jpg' -7 -Y '/tmp/a[12]*4' -0 archive can be used to archive | |||
files all files under /tmp, even files with a '\n' character in the name, except for .jpg | files all files under /tmp, even files with a '\n' character in the name, except for .jpg | |||
files and the file with the exact name /tmp/a[12]*4. A seco nd use of -7 toggles the match- | files and the file with the exact name /tmp/a[12]*4. A seco nd use of -7 toggles the match- | |||
ing for subsequently occuring -y, -Y, -w, and -W back to she ll wildcard pattern matching. | ing for subsequently occuring -y, -Y, -w, and -W back to she ll wildcard pattern matching. | |||
-8 directive Modify various behavior regarding symlinks. The directive n | ||||
osymlinks applies to both ar- | ||||
chive creation and archive unpacking. During archive creati | ||||
on, it suppresses the inclusion | ||||
of any symlink entry in the archive. In unpacking, it suppr | ||||
esses the unpacking of any sym- | ||||
link entry in the archive. This directive does not affect | ||||
the interpretation of existing | ||||
symlinks on the filesystem during the path resolution proc | ||||
ess where afio resolves the | ||||
directory name components in front of the last / in a path | ||||
name. The directive allowinse- | ||||
curepaths applies to the security of archive unpacking. As o | ||||
f version 2.5.2, afio has pro- | ||||
tection mechanisms that apply to the unpacking of pote | ||||
ntially untrusted archives. On | ||||
unpacking, afio will by default (since version 2.5.2) inspec | ||||
t every pathname in the archive | ||||
to detect the occurrence of a .. subpath in it. If one or mo | ||||
re of these are present this is | ||||
almost almost certainly due to the archive having been const | ||||
ructed by an attacker. The | ||||
goal of the attack would be to have the afio unpacking oper | ||||
ation over-write system or user | ||||
files with new contents, via the use of using specially | ||||
constructed path names like | ||||
../../../../../etc/password or ../../../../../home/a_user/.b | ||||
ashrc that resolve to the loca- | ||||
tion of such configuration files. Therefore, if any .. subp | ||||
aths are detected in a path | ||||
name in an archive being unpacked, afio issues a warning, | ||||
and then rewrites every '..' in | ||||
the path name to 'XX', and the archive entry is unpacked | ||||
to the rewritten path name | ||||
instead. The allowinsecurepaths directive disables the abo | ||||
ve rewriting of likely-insecure | ||||
path names. Note that afio, while unpacking an archive, wil | ||||
l also protect against that ar- | ||||
chive including potentially insecure path names that start | ||||
with a leading /, by stripping | ||||
off the leading / before using the path name is used, which | ||||
has the effect of the archive | ||||
entry relative to the current working directory. This str | ||||
ipping behavior can be disabled | ||||
with the -A option. The directive allowinsecuresymlinks app | ||||
lies to a further the protec- | ||||
tion mechanism that applies to the unpacking of potentially | ||||
untrusted archives. On unpack- | ||||
ing, afio will by default (since version 2.5.2) inspect ever | ||||
y symlink destination in the | ||||
archive to detect the occurrence of a leading / or a .. su | ||||
bpath in it. If a leading / or | ||||
.. subpaths are detected in the symlink destination, afio i | ||||
ssues a warning, rewrites them | ||||
to X or XX, and the result is used as the unpacked sy | ||||
mlink destination instead. The | ||||
allowinsecuresymlinks directive disables this protective rew | ||||
riting behavior. Some further | ||||
background: an attacking archive with an insecure symlin | ||||
k will typically include, as an | ||||
entry after the insecure symlink, a file entry with a path t | ||||
hat follows the insecure sym- | ||||
link leading to a location in the filesystem where a system | ||||
or user configuration file can | ||||
be overwritten. An archive with an insecure symlink may be | ||||
created most easily an attacker | ||||
who has the entire archive creation process under their cont | ||||
rol. However, in another case, | ||||
the attacker is an untrusted end user on a multi-user system | ||||
, where a trusted system admin- | ||||
istrator is creating a backup of a live file system containi | ||||
ng directories under control of | ||||
the untrusted end user. The untrusted end user can potentia | ||||
lly exploit race conditions in | ||||
the backup process, by creating temporary symlinks and fil | ||||
es in their own home directory, | ||||
resulting in in archive contents that would modify system co | ||||
nfiguration files when later | ||||
unpacked if the protection mechanism were disabled using t | ||||
he allowinsecuresymlinks direc- | ||||
tive. The above described protection mechanisms are limited | ||||
to symlinks. A untrusted ar- | ||||
chive attack that uses specially constructed hard link entr | ||||
ies in the archive is theoreti- | ||||
cally possible with some archivers, but is not possible with | ||||
afio, because of the special | ||||
way that afio represents hard links in an archive. | ||||
-9 Do not round down any -s volume sizes to the nearest -b bloc k size. See the -s option. | -9 Do not round down any -s volume sizes to the nearest -b bloc k size. See the -s option. | |||
ARCHIVE PORTABILITY | ||||
afio archives are portable between different types of UNIX systems, as th | ||||
ey contain only ASCII-formatted | ||||
header information. | ||||
Except in special cases discussed below, afio will create archives with t | ||||
he same format as ASCII cpio(1) | ||||
archives. Therefore cpio(1) can usually be used to restore an afio archi | ||||
ve in the case that afio is not | ||||
available on a system. (With most cpio versions, to unpack an ASCII forma | ||||
t archive, use cpio -c, and for | ||||
GNU cpio(1) use cpio -H odc.) When unpacking with cpio, any compressed | ||||
files inside an afio -Z archive | ||||
are not uncompressed by cpio, but will be created on the file system as | ||||
compressed files with a .z | ||||
extension. | ||||
Unfortunately, the ASCII cpio archive format cannot represent some files | ||||
and file properties that can be | ||||
present in a modern UNIX filesystem. If afio creates an archive with suc | ||||
h things, then it uses an afio- | ||||
specific 'large ASCII' header for the files concerned. Archives wit | ||||
h large ASCII headers cannot be | ||||
unpacked completely by cpio or afio versions before 2.4.8. | ||||
When creating an archive, the `large ASCII' header is used by afio to cov | ||||
er the following situations: | ||||
o A file has a size larger than 2 GB | ||||
o The archive contains more than 64K files which have hard links | ||||
o A file, directory, or special file has a UID or GID value larger th | ||||
an 65535. | ||||
The -5 option can be used to always preserve cpio compatibility, it will | ||||
cause afio to fail rather than | ||||
produce an incompatible archive in the cases above. | ||||
Archives made using the (deprecated) -4 option are also not compatible w | ||||
ith cpio, but they are compati- | ||||
ble with afio versions 2.4.4 and later. | ||||
ARCHIVE FILE FORMAT | ||||
An afio archive file has a simple format. The archive starts with a file | ||||
header for the first file, fol- | ||||
lowed by the contents of the first file (which will either be the exact | ||||
contents byte-for-byte, or the | ||||
exact contents in some compressed format). The data of the first file is | ||||
immediately followed by the | ||||
file header of the second file, and so on. At the end, there is a specia | ||||
l `end of archive' header, usu- | ||||
ally followed by some padding bytes. | ||||
A multi-volume afio archive is simply a normal archive split up into mult | ||||
iple parts. There are no spe- | ||||
cial volume-level data headers. This means that that volumes can be sp | ||||
lit and merged by external pro- | ||||
grams, as long as the data stays in the correct order. It also implies t | ||||
hat the contents of a single | ||||
file can cross volume boundaries. Selective restores of files at known | ||||
volume locations can be done by | ||||
feeding only the needed volumes to afio, provided that the -k option is u | ||||
sed. | ||||
The contents of hard linked files are (unless the -l option is used) only | ||||
stored once in the archive. | ||||
The file headers for the second, third, and later occurrence of a hard | ||||
linked file have no data after | ||||
them. This makes selective restores of hard-liked files difficult: if | ||||
later occurrences are to be | ||||
restored correctly, the first occurrence always needs to be selected too. | ||||
NOTES | NOTES | |||
Special-case archive names: | Special-case archive names: | |||
o Specify - to read or write the standard input or output, respective ly. This disables multi-volume | o Specify - to read or write the standard input or output, respective ly. This disables multi-volume | |||
archive handling. | archive handling. | |||
o Prefix a command string to be executed with an exclamation mark (!) . The command is executed once | o Prefix a command string to be executed with an exclamation mark (!) . The command is executed once | |||
for each archive volume, with its standard input or output piped to afio. It is expected to pro- | for each archive volume, with its standard input or output piped t o afio. It is expected to pro- | |||
duce a zero exit code when all is well. | duce a zero exit code when all is well. | |||
o Use system:file to access an archive in file on system. This i s really just a special case of | o Use system:file to access an archive in file on system. This is re ally just a special case of | |||
pipelining. It requires a 4.2BSD-style remote shell (rsh(1C)) and a remote copy of afio. | pipelining. It requires a 4.2BSD-style remote shell (rsh(1C)) and a remote copy of afio. | |||
o A more elaborate case of the above is [user@]host[%rsh][=afio]:file where the optional user@ com- | o A more elaborate case of the above is [user@]host[%rsh][=afio]:fil e where the optional user@ com- | |||
ponent specifies the user name on the remote host, the optional %rs h specifies the (local) name of | ponent specifies the user name on the remote host, the optional %rs h specifies the (local) name of | |||
the remote shell command to use, and the optional =afio specifies t he name of the remote copy of | the remote shell command to use, and the optional =afio specifies the name of the remote copy of | |||
the afio command. | the afio command. | |||
o Anything else specifies a local file or device. An output file will be created if it does not | o Anything else specifies a local file or device. An output file wil l be created if it does not | |||
already exist. | already exist. | |||
Recognizes obsolete binary cpio(1) archives (including those from machine | o When the -s option is used to invoke multi-volume archive proces | |||
s with reversed byte order), | sing, any %V in the file/device | |||
name or command string is subsisuted by the current volume number, | ||||
and any %S by the current vol- | ||||
ume size. Use %% to produce a single % character. | ||||
Recognizes obsolete binary cpio(1) archives (including those from mach | ||||
ines with reversed byte order), | ||||
but cannot write them. | but cannot write them. | |||
Recovers from archive corruption by searching for a valid magic number. This is rather simplistic, but, | Recovers from archive corruption by searching for a valid magic number. T his is rather simplistic, but, | |||
much like a disassembler, almost always works. | much like a disassembler, almost always works. | |||
Optimizes pathnames with respect to the current and parent | ||||
directories. For example, | ||||
./src/sh/../misc/afio.c becomes src/misc/afio.c. | ||||
CONTROL FILES | CONTROL FILES | |||
Afio archives can contain so-called control files. Unlike normal archive entries, a control file in not | Afio archives can contain so-called control files. Unlike normal archive entries, a control file in not | |||
unpacked to the filesystem. A control file has a label and some data. W hen afio encounters a control | unpacked to the filesystem. A control file has a label and some data. W hen afio encounters a control | |||
file in the archive it is reading, it will feed the label and data to a so-called control script. The | file in the archive it is reading, it will feed the label and data to a so-called control script. The | |||
control script is supplied by the user. It can perform special actions b ased on the label and data it | control script is supplied by the user. It can perform special actions b ased on the label and data it | |||
receives from afio. | receives from afio. | |||
Control file labels. The control file mechanism can be used for many th ings. Examples are putting ar- | Control file labels. The control file mechanism can be used for many th ings. Examples are putting ar- | |||
chive descriptions at the beginning of the archive and embedding lists of files to move before unpacking | chive descriptions at the beginning of the archive and embedding lists of files to move before unpacking | |||
the rest or the archive. | the rest or the archive. | |||
To distinguish between different uses, the label of a control file should indicate the program that made | To distinguish between different uses, the label of a control file should indicate the program that made | |||
the contol file and the purpose of the control file data. It should have the form | the control file and the purpose of the control file data. It should hav e the form | |||
programname.kindofdata | programname.kindofdata | |||
where programname is the name of the backup program that generated the co ntrol file, and kindofdata is | where programname is the name of the backup program that generated the co ntrol file, and kindofdata is | |||
the meaning of the control file data. Some examples are | the meaning of the control file data. Some examples are | |||
tbackup.movelist tbackup.updatescript | tbackup.movelist tbackup.updatescript | |||
blebberfiler.archivecontents | blebberfiler.archivecontents | |||
backup_script_of_Joe_User.archivedescription | backup_script_of_Joe_User.archivedescription | |||
skipping to change at line 542 | skipping to change at line 596 | |||
Control scripts. A control script is supplied to afio with the | Control scripts. A control script is supplied to afio with the | |||
-D controlscript | -D controlscript | |||
command line option. The controlscript must be an executable program. T he script is run whenever afio | command line option. The controlscript must be an executable program. T he script is run whenever afio | |||
encounters a control file while doing a -i -t or -r operation. Afio wil l supply the control file label | encounters a control file while doing a -i -t or -r operation. Afio wil l supply the control file label | |||
as an argument to the script. The script should read the control file da ta from its standard input. If | as an argument to the script. The script should read the control file da ta from its standard input. If | |||
the script exits with a non-zero exit status, afio will issue a warning m essage. | the script exits with a non-zero exit status, afio will issue a warning m essage. | |||
If a contol file is encountered and no -D option is given, afio will is sue a warning message. To sup- | If a control file is encountered and no -D option is given, afio will is sue a warning message. To sup- | |||
press the warning message and ignore all control scripts, -D "" can be us ed. | press the warning message and ignore all control scripts, -D "" can be us ed. | |||
An example of a control script is | An example of a control script is | |||
#!/bin/sh | #!/bin/sh | |||
if [ $1 = "afio_example.headertext" ]; then | if [ $1 = "afio_example.headertext" ]; then | |||
#the headertext control file is supposed to be packed as the first | #the headertext control file is supposed to be packed as the first | |||
#entry of the archive | #entry of the archive | |||
echo Archive header: | echo Archive header: | |||
cat - | cat - | |||
skipping to change at line 583 | skipping to change at line 637 | |||
Restricts pathnames to 1023 characters, and 255 meaningful elements (w here each element is a pathname | Restricts pathnames to 1023 characters, and 255 meaningful elements (w here each element is a pathname | |||
component separated by a /). | component separated by a /). | |||
Does not use the same default block size as tar(1). tar(1) uses 10 KB, a fio uses 5 KB by default. Some | Does not use the same default block size as tar(1). tar(1) uses 10 KB, a fio uses 5 KB by default. Some | |||
tape drives only work with a 10 KB block size, in that case the afio opti on -b 10k is needed to make the | tape drives only work with a 10 KB block size, in that case the afio opti on -b 10k is needed to make the | |||
tape work. | tape work. | |||
There is no sequence information within multi-volume archives. Input seq uence errors generally masquer- | There is no sequence information within multi-volume archives. Input seq uence errors generally masquer- | |||
ade as data corruption. A solution would probably be mutually exclusive with cpio(1) compatibility. | ade as data corruption. A solution would probably be mutually exclusive with cpio(1) compatibility. | |||
Degenerate uses of symbolic links are mangled by pathname optimizati | ||||
on. For example, assuming that | ||||
"usr.src" is a symbolic link to "/usr/src", the pathname "usr.src/../b | ||||
in/cu" is mis-optimized into | ||||
"bin/cu" (rather than "/usr/bin/cu"). | ||||
The afio code for handling floppies (-F and -f and -K options) has buggy error handling. afio does not | The afio code for handling floppies (-F and -f and -K options) has buggy error handling. afio does not | |||
allow one to retry a failed floppy write on a different floppy, and it c annot recover from a verify | allow one to retry a failed floppy write on a different floppy, and it c annot recover from a verify | |||
error. If the floppy handling code is used and write or verify errors do occur, it is best to restart | error. If the floppy handling code is used and write or verify errors do occur, it is best to restart | |||
afio completely. Making backups to floppies should really be done with a more specialised backup pro- | afio completely. Making backups to floppies should really be done with a more specialised backup pro- | |||
gram that wraps afio. | gram that wraps afio. | |||
The Linux floppy drivers below kernel version 1.1.54 do not allow afio to find out about floppy write | The Linux floppy drivers below kernel version 1.1.54 do not allow afio to find out about floppy write | |||
errors while writing. If you are running a kernel below 1.1.54, afio wil l happily fail to write to | errors while writing. If you are running a kernel below 1.1.54, afio wil l happily fail to write to | |||
(say) a write protected disk and not report anything wrong! The only way to find out about write errors | (say) a write protected disk and not report anything wrong! The only way to find out about write errors | |||
in this case is by watching the kernel messages, or by switching on the v erify (-K) option. | in this case is by watching the kernel messages, or by switching on the v erify (-K) option. | |||
skipping to change at line 640 | skipping to change at line 690 | |||
all subsequent copies, if selected, will not be correctly restored. 4) U nless the -4 option is used, | all subsequent copies, if selected, will not be correctly restored. 4) U nless the -4 option is used, | |||
the inode number fields in the archive headers for files with hard link s of the archive will sometimes | the inode number fields in the archive headers for files with hard link s of the archive will sometimes | |||
not contain the actual (least significant 16 bits of) the inode number of the original file. | not contain the actual (least significant 16 bits of) the inode number of the original file. | |||
Some Linux kernels no not allow one to create a hard link to a symbolic l ink. afio will try to re-cre- | Some Linux kernels no not allow one to create a hard link to a symbolic l ink. afio will try to re-cre- | |||
ate such hard links when unpacking an archive, but might fail due to kern el restrictions. | ate such hard links when unpacking an archive, but might fail due to kern el restrictions. | |||
Due to internal limitations of afio, the use of the -U option forces t he writing of file content with | Due to internal limitations of afio, the use of the -U option forces t he writing of file content with | |||
each hard linked file, rather than only once for every set of hard linked files. | each hard linked file, rather than only once for every set of hard linked files. | |||
When it is run without super-user priviliges, afio is not able to unpack a file into a directory for | When it is run without super-user privileges, afio is not able to unpack a file into a directory for | |||
which it has no write permissions, even if it just created that directory itself. This can be a problem | which it has no write permissions, even if it just created that directory itself. This can be a problem | |||
when trying to restore directory structures created by some source code c ontrol tools like RCS. | when trying to restore directory structures created by some source code c ontrol tools like RCS. | |||
When block or character device files are packed into an archive on one op erating system (e.g. Linux) and | When block or character device files are packed into an archive on one op erating system (e.g. Linux) and | |||
unpacked on another operating system, which uses different sizes for th e major and minor device number | unpacked on another operating system, which uses different sizes for th e major and minor device number | |||
data types (e.g. Solaris), the major and minor numbers of the device file s will not be restored cor- | data types (e.g. Solaris), the major and minor numbers of the device file s will not be restored cor- | |||
rectly. This can be a problem if the operating systems share a cross-mo unted filesystem. A workaround | rectly. This can be a problem if the operating systems share a cross-mo unted filesystem. A workaround | |||
is to use tar(1) for the device files. | is to use tar(1) for the device files. | |||
SECURITY CONSIDERATIONS | ||||
Security considerations arise when unpacking archives from untrusted sour | ||||
ces. The recommended technique | ||||
is to unpack such archives into a temporary, empty destination director | ||||
y, unaccessible to other system | ||||
users, while running afio as a normal user, so without superuser privileg | ||||
es. As of version 2.5.2, afio | ||||
has security measures, enabled by default, to guard against a class | ||||
of attacks where specially con- | ||||
structed path names and/or symlink destinations in an archive cause afio | ||||
to to create or modify system | ||||
or user files outside of the destination directory. See the -8 option | ||||
for a more detailed description | ||||
of these attacks and measures. | ||||
On UNIX multi-user systems with untrusted users, there are several known | ||||
attacks where, unless the sys- | ||||
tem administrator is very careful, end users can exploit backup an | ||||
d restore activites on the user | ||||
filesystems to subvert data or operational security. See e.g. the securi | ||||
ty section of the GNU tar man- | ||||
ual, at | ||||
http://www.gnu.org/software/tar/manual/html_node/Security.html | ||||
for a description of some issues and precautions. | ||||
An archive from an untrusted source could in theory contain mal-formatt | ||||
ed data designed to implement a | ||||
buffer overflow attack when afio reads the archive during a -t or -i oper | ||||
ation. While the afio archive | ||||
procesing code is fairly robust, and has passed some automated code check | ||||
ing tools, no formal review has | ||||
been done to guarantee the absense of buffer overflow attack vulnerabilit | ||||
ies. Running afio in a sand- | ||||
boxed virtual machine or from inside chroot(8) will improve the sec | ||||
urity of handling archives from | ||||
untrusted sources, but the most secure option is to never touch such arch | ||||
ives at all. | ||||
EXAMPLES | EXAMPLES | |||
Create an archive with compressed files: | Create an archive with compressed files: | |||
find .... | afio -o -v -Z /dev/fd0H1440 | find .... | afio -o -v -Z /dev/fd0H1440 | |||
Install (unpack) an archive with compressed files: | Install (unpack) an archive with compressed files: | |||
afio -i -v -Z achive | afio -i -v -Z archive | |||
Install (unpack) an archive with compressed files, protecting newer exist ing files: | Install (unpack) an archive with compressed files, protecting newer exist ing files: | |||
afio -i -v -Z -n achive | afio -i -v -Z -n archive | |||
Create an archive with compressed files on floppy disks: | Create an archive with compressed files on floppy disks: | |||
find .... | afio -o -v -s 1440k -F -Z /dev/fd0H1440 | find .... | afio -o -v -s 1440k -F -Z /dev/fd0H1440 | |||
Create an archive with all file contents encrypted by pgp: | Create an archive with all file contents encrypted by pgp: | |||
export PGPPASSFD=3 | export PGPPASSFD=3 | |||
find .... | afio -ovz -Z -U -P pgp -Q -fc -Q +verbose=0 -3 3 archive 3<pa ssphrasefile | find .... | afio -ovz -Z -U -P pgp -Q -fc -Q +verbose=0 -3 3 archive 3<pa ssphrasefile | |||
Create an archive on recordable CDs using the cdrecord utility to write e ach CD: | Create an archive on recordable CDs using the cdrecord utility to write e ach CD: | |||
find .... | afio -o -b 2048 -s325000x -v '!cdrecord .... -' | find .... | afio -o -b 2048 -s325000x -v '!cdrecord .... -' | |||
skipping to change at line 693 | skipping to change at line 766 | |||
find /home | afio -o ... - | split -b1024m - archive. | find /home | afio -o ... - | split -b1024m - archive. | |||
the files will be called archive.aa, archive.ab, etc. You can restore th e whole archive using: | the files will be called archive.aa, archive.ab, etc. You can restore th e whole archive using: | |||
cat archive.* | afio -i ... - | cat archive.* | afio -i ... - | |||
The wildcard expansion by the shell will ensure that cat will read the pa rts in the right (alphabetic) | The wildcard expansion by the shell will ensure that cat will read the pa rts in the right (alphabetic) | |||
order. | order. | |||
SEE ALSO | SEE ALSO | |||
cpio(1), find(1), tar(1), compress(1), gzip(1). | cpio(1), find(1), tar(1), compress(1), gzip(1). | |||
WEB SITE AND INTERNET RESOURCES | WEB SITE AND INTERNET RESOURCES | |||
There is no official web site for afio. However, the current maintainer | The afio home page is at http://members.chello.nl/~k.holtman/afio.html | |||
does post information on alpha, | See the home page for information on submitting questions, bug reports, p | |||
beta, and production releases at http://freecode.com/projects/afio/ | atches, etc. | |||
The Debian project maintains a binary distribution package of afio, see h | ||||
ttp://packages.debian.org | ||||
Bug reporting on the Debian package can be done to the Debian project, bu | ||||
gs with a scope beyond Debian | ||||
will usually also reach the current afio maintainer mentioned below. | ||||
For general bug reporting, patches, suggestions and status inquiries, | ||||
please e-mail the current afio | ||||
maintainer. Though the maintenance and distribution effort of afio is | ||||
Linux-centered, correspondence | ||||
with respect to the use of afio on other operating systems is also welcom | ||||
e. | ||||
When mailing the maintainer, please use the word `afio' somewhere in th | ||||
e subject line, this lowers the | ||||
chance that your mail will get accidentally deleted. The current maintain | ||||
er e-mail address is: | ||||
koen.holtman@ieee.org | ||||
AUTHORS | AUTHORS | |||
Mark Brukhartz | Mark Brukhartz | |||
Jeff Buhrt | Jeff Buhrt | |||
Dave Gymer | Dave Gymer | |||
Andrew Stevens | Andrew Stevens | |||
Koen Holtman (current maintainer) koen.holtman@ieee.org | Koen Holtman (current maintainer) koen.holtman@ieee.org | |||
Anders Baekgaard | Anders Baekgaard | |||
Too many other people to list here have contributed code, patches, ideas, and bug reports. Many of | Too many other people to list here have contributed code, patches, i deas, and bug reports. Many of | |||
these are mentioned in the HISTORY file that is included with the sources . | these are mentioned in the HISTORY file that is included with the sources . | |||
AFIO(1) | AFIO(1) | |||
End of changes. 50 change blocks. | ||||
314 lines changed or deleted | 436 lines changed or added |