[filename generator] | afio -o [options] archive : write archive afio -i [options] archive : install archive afio -t [options] archive : list table-of-contents of archive afio -r [options] archive : verify archive against filesystem
Frequently used options:
General: -v : verbose -Z : with -o: gzip files when writing them to the archive, with -i/t/r: handle archive written with -Z option -5 : abort instead of creating archive incompatible with cpio
Install: -n : protect newer files -k : skip corrupt data at beginning Select: -y [pattern] : only process files matching pattern -Y [pattern] : do not process files matching pattern
-h Follow symbolic links, treating them as ordinary files and directories.
afio is a better way of dealing with cpio-format archives. It is generally faster than cpio, provides more diverse magnetic tape options and deals somewhat gracefully with input data corruption. It supports multivolume archives during interactive operation. afio can make compressed archives that are much safer than compressed tar or cpio archives. afio is best used as an "archive engine" in a backup script.
$ find . -depth -print0 | afio -px -0a new-dir
All my backups onto tape use afio.
http://www.linuxgazette.com/node/8447
The nice thing about using afio with the compression option is that because of the way that afio stores its archives, if one of the files becomes corrupted — hey, it can happen to anyone — it doesn't prevent you from retrieving the remainder of the intact files. If you tar and gzip an archive and it has an error, you're out of luck, pal. It's history. The whole thing.
Create an archive with compressed files: find .... | afio -o -v -Z /dev/fd0H1440
Install (unpack) an archive with compressed files: afio -i -v -Z achive
Install (unpack) an archive with compressed files, protecting newer existing files: afio -i -v -Z -n achive
Create an archive with compressed files on floppy disks: find .... | afio -o -v -s 1440k -F -Z /dev/fd0H1440
Create an archive with all file contents encrypted by pgp: export PGPPASSFD=3 find .... | afio -ovz -Z -U -P pgp -Q -fc -Q +verbose=0 -3 3 archive 3<passphrasefile
Create an archive on recordable CDs using the cdrecord utility to write each CD: find .... | afio -o -b 2048 -s325000x -v '!cdrecord .... -'
Extract a single named file from an archive on /dev/tape: afio -i -v -Z -y /home/me/thedir/thefile /dev/tape (If these do not exist yet, afio will also create the enclosing direc- tories home/me/myfiledir under current working directory.)
Extract files matching a pattern from an archive on /dev/tape: afio -i -v -Z -y '/home/me/*' /dev/tape (If these do not exist yet, afio will also create the enclosing directories home/me under current working directory.)
If your filesystem cannot handle files larger than 2GB, but you want to make an archive on that filesystem that is larger than 2GB, you use the following trick to split the archive into multiple files of each 1 GB: find /home | afio -o ... - | split -b1024m - archive. the files will be called archive.aa, archive.ab, etc. You can restore the whole archive using: cat archive.* | afio -i ... - The wildcard expansion by the shell will ensure that cat will read the parts in the right (alphabetic) order.