A few years ago, John Pezzano from Hewlett-Packard did a paper comparing native backup products. It is the best one that I have seen, so I asked his permission to update it a bit to reflect changes in the utilities and include it in this book. Table 3-3 compares tar, cpio, and dump.
Table 3-3. Conversion of native utilities
| Feature | tar | cpio | dump |
|---|
| Simplicity of invocation | Very simple(tar c files) | Needs find to specify filenames | Simplefew options |
| Recovery from I/O errors | Nonewrite your own utility | resync option on HP-UX causes some data loss | Automatically skips over bad section |
| Back up special files | Later revisions | Yes | Yes |
| Multivolume backup | Later revisions | Yes | Yes |
| Back up across network | Using rsh/ssh only | Using rsh/ssh only | 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 | Difficultmust search entire backup (tar -t) | Difficultmust search entire backup (cpio -it) | Simpleindex at front (restore -t) |
| Ease and speed of finding a particular file | Difficultno wildcards; must search entire volume | Moderatewildcards; must search entire volume | Interactivevery easy with commands like cd, ls |
| Incremental backup | Can use newer or find if using GNU tar | 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 2> logfile | cpio -v 2> logfile | Only after backup with restore -t > logfile (dump can show % complete, though) |
| Back up based on other criteria | Yes, with GNU tar | find can use multiple criteria | No |
| Restore absolute pathnames to relative location | Yes, with GNU tar | With cpio I, or with GNU cpio | Always relative to current working directory |
| Interactive decision on restore | Yes or no possible with tar -w | Can specify new path or name on each file | Specify individual files in interactive mode |
| Compatibility | Multiple platform | Multiple platform with ASCII header, not always portable | Readable between some platforms, but cannot be relied on |
| Primary usefulness | System backup if GNU tar, otherwise 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 | Mediumusually only 5 K block size, but can specify larger size on some OSes | Highcan 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 numerous directories | Lowmust specify each independent directory, subdirectories included | Mediumfind options | Nonebacks up one and only one filesystem |
| Specifying directory on restore gets files in that directory | Yes | Nomust use path/* | Yes |
| Stop reading tape after a restored file is found | No | No | Stops reading tape as soon as last file is found |
| Track deleted files | No | No | If you restore with -r, files deleted before last incremental dump are deleted |
| Filesystem efficiency | Better | Worst (files get a stat from both find and cpio) | Best |
| Likelihood that file exists in TOC but not in archive | Low | Low | Medium (because TOC is made first) |
Standard backup utilities may not be very sexy or even full of features, but if you get to know them, they will always be there. Some of the "semi-native" commands (for example, GNU tar, GNU cpio) are also very helpful, but they are not always available. Therefore, a good working knowledge of the truly native commands can come in very handy when you're in a jam or when someone hands you an unknown volume and says "Can you read this?"