# Chapter 38. Backing Up Files

#### Contents:

What Is This "Backup" Thing?
tar in a Nutshell
Make Your Own Backups
More Ways to Back Up
How to Make Backups to a Local Device
Restoring Files from Tape with tar
Using tar to a Remote Tape Drive
Using GNU tar with a Remote Tape Drive
On-Demand Incremental Backups of a Project
Using Wildcards with tar
Avoid Absolute Paths with tar
Getting tar's Arguments in the Right Order
The cpio Tape Archiver
Industrial Strength Backups

## 38.1. What Is This "Backup" Thing?

Making copies of critical files in case the originals become inaccessible is called backing them up or making backups. Backups are insurance. They are time and effort you spend protecting yourself from things that might never happen. Your hard drive might never crash, but what vital things would you lose if it did?

Exactly what "making a backup" means varies depending on your circumstances. All of the following examples are ways to make backups applicable to some specific environment:

- Copying some files onto another disk on the same machine, so that if one hard drive dies you still have a copy. (A more sophisticated and automatic way of doing this, which you may have heard about, is called Redundant Array of Inexpensive Disks or RAID.)

- Making a compressed tar file and copying it to another machine, so that if one machine crashes you still have a copy.

- Writing copies of your files to a Zip drive, CD-RW, or DVD-RW.

- tarring (Section 38.2) files to a tape.

- Nightly automatic backups of everything that's changed that day (called an incremental backup) to multiple tapes, with copies of the tapes stored in offsite secure storage.

If you are just trying to protect your files on your personal machine, simply making sure that critical files have copies on multiple physical disks or occasionally copying files onto another machine or removable storage is probably sufficient. If you're administering a machine that has multiple users, regular backups are almost certainly a necessity. If those users are doing business-critical tasks, very regular backups and off-site copies are a requirement to protect the investment of time involved.

-- DJPH

Copyright © 2003 O'Reilly & Associates. All rights reserved.