$
Learn Linux handbook
en
XP:0

Chapter 15 of 17

Make backups you can restore

Treat a successful restore as the proof of a backup.

The mental model.

tar groups files into an archive; gzip, bzip2, and xz compress data. A .tar.gz commonly combines archiving and compression. List an unfamiliar archive before extracting and use a separate destination to avoid overwriting working files.

rsync synchronizes trees. The trailing slash on a source directory matters: source/ copies its contents, while source copies the directory itself. Preview real synchronizations with --dry-run, especially before using --delete.

A SHA-256 checksum detects changes relative to a trusted checksum. It does not prove authenticity if an attacker can replace both the file and its checksum. Verify vendor signatures or checksums obtained through a trusted channel.

Keep multiple copies across failure domains, including an offline or otherwise isolated copy. Define recovery point and recovery time requirements. Regularly restore to a fresh location and verify file contents, ownership, permissions, and application behavior.

Read it. Predict it. Try it.

Before running these commands, predict what each line will change or print. Launch a quest below to open the simulated terminal.

tar -czf notes-backup.tar.gz notes.txt
tar -tf notes-backup.tar.gz
sha256sum notes-backup.tar.gz

Create, inspect, and fingerprint an archive. The real backup lab adds extraction into a new directory and content comparison.

Check your understanding

Explain the why.

What is the strongest practical check that a backup is useful?

Put it into practice.

Complete the exercises, then try the Boss Challenge without hints. Each quest checks its own objectives. You can revisit this chapter at any time.

Prefer to read first?

Make the learning stick.

Close the explanation and describe the main idea in your own words. Change a filename or input and predict the outcome. Tomorrow, repeat a quest without hints. Then apply it in a disposable real Linux environment.

Open the real-system labs →