The following table compares each of their strengths and weaknesses 1
Feature | tar | cpio | dump | |
Simplicity of invocation | Very Simple (tar c files) | Needs find to specify filenames | Simple--few options | |
Recovery From I/O errors | None--write your own utility | Resync option on HP-UX will cause some data loss | Automatically skips over bad section | |
Back up special files | Later revisions | Yes | Yes | |
Multivolume backup | Later revisions | Yes | Yes | |
Back up accross network | Using rsh only | Yes | Yes | |
Append files to backup | Yes (tar-r) | No | No | |
Multiple independent backups on single tape | Yes | Yes | Yes | |
Ease of listing files on the volume | Difficult--must search entire backup (tar-t) | Difficult--must search entire backup (cpio-it) | Simple--index at front (restore -t) | |
Incremental backup | No | Must use find to locate new/modified files | Incremental of whole filesystem only, multiple levels | |
List files as they are being backed up | tar cvf 2logfile | Only after backup with restore -t logfile | (dump can show % complete, though) | |
Back up based on other criteria | No | find can use multiple criteria | No | |
Restore absolute pathnames to relative location | Only by using chroot | Limited with cpio-I | Always relative to current working directory | |
Compatibility | Multiple platform | Multiple platform with ASCII header, not always protable | Readable between some platforms, but cannot be relied on | |
Primary usefulness | Individual user backup, transfer files between filesystems | System backup, transfer files between filesystems | System backup | |
Volume efficiency | Medium, usually limited to 10 K block size | Medium, usually only 5 K block size, but can specify larger size on some OSes | High, can usually specify up to maximum block size of device | |
Wildcards on Restore | No | Yes | only in interactive mode | |
Simplicity of selecting files for backup from numberous directory | Low--must specivy each independent directory, subdirectories included | Medium--find options | None--will back up one and only one filesystem |
Generally, if you had your choice of native backup tools, dump should probably be your best choice. Not only is it relatively simple to use, it also has a great amount of functionality built in. This leaves the administrator free to think more about what he wants to back up and less about how he needs to back it up. Dump also spawns several processes, making it faster. Finally, Dump provides a mechanism built in for interactive file recovery. The syntax of dump is as follows:
dump levelunbdsf blkg-factor density size device-name file_system
/sbin/dump -0u -f /dev/st0 /your/filesystem/to/backup
To get a list of the files from the tape, enter this:
restore -t /dev/st0
Of course, you can pipe this output out to a file.