Build and verify a portable tar archive

8 steps · about 2 h 29 min · Intermediate

  1. Create an archive from explicit paths (guide, GNU tar manual, 20 min)

    Control the working directory and member names so restoration does not depend on one machine's layout.

  2. Exclude generated and sensitive files (guide, GNU tar manual, 18 min)

    Keep caches, secrets and irrelevant output out of the archive by an auditable rule.

  3. Choose a compression format (guide, GNU tar manual, 18 min)

    Apply compression separately from the archive structure and retain a recognizable suffix.

  4. Inspect the archive manifest (guide, GNU tar manual, 18 min)

    Review member names, sizes and metadata without extracting them.

  5. Check archive readability (guide, GNU tar manual, 18 min)

    Test the compressed stream and archive before moving or deleting any source data.

  6. Record a SHA-256 checksum (reference, GNU Coreutils manual, 15 min)

    Detect corruption or substitution when the archive moves between systems.

  7. Restore into a clean destination (guide, GNU tar manual, 22 min)

    Prove that the archive is usable without overwriting the original tree.

  8. Audit restored permissions and ownership (guide, GNU tar manual, 20 min)

    Verify which metadata was preserved and avoid restoring unsafe ownership or modes blindly.