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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.