Chapter 8. Backups and Removable Media

Data backups in UNIX were traditionally done by running commands to archive and compress the files to backup, and then writing that backup archive to tape. Options for archive tools, compression techniques, and backup media have grown tremendously in recent years. Tape archiving has, for many, been replaced by techniques for backing up data over the network, to other hard disks, or to CDs, DVDs, or other low-cost removable media.

This chapter details some useful tools for backing up and restoring your critical data. The first part of the chapter details how to use basic tools such as tar, gzip, and rsync for backups.

Backing Up Data to Compressed Archives

If you are coming from a Windows background, you may be used to tools such as WinZip and PKZIP, both of which archive and compress groups of files in one application. BSD systems offer separate tools for gathering groups of files into a single archive (such as tar) and compressing that archive for efficient storage (gzip, bzip2, and others). However, you can also merge the two steps by using additional options to the tar command.

Creating Backup Archives with tar

The tar command, which stands for tape archiver, dates back to early UNIX systems. Although magnetic tape was the common medium that tar wrote to originally, ...

Get MAC OS® X UNIX® Toolbox: 1000+ Commands for the Mac OS® X now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.