Back to commands

Hosting Operations

Deletes or truncates files

Check Required Files After Restore

You need to confirm every required path exists in the restored sandbox.

Command

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && find restore-sandbox/full -type f | sed 's#^restore-sandbox/full/##' | sort | comm -23 required-files.txt -

Before you run this

System impact: Deletes, truncates, or overwrites data. Requires backup, preview, and exact path review before production use.

When not to use it: Do not rely on this alone for content integrity; pair it with checksums.

Expected output

No output means no required files are missing.

System impact

Deletes or truncates files. The existing restore-sandbox/full directory is removed and recreated, then file paths are compared.

When to use it

Use after sandbox extraction to prove required files are present.

When not to use it

Do not rely on this alone for content integrity; pair it with checksums.

Recovery / rollback

Remove the restore-dr/restore-sandbox/full directory from the fixture copy. Never point the rm -rf path at production data.

Watch this command run

Example output from a temporary Linux lab

This example uses disposable sample files and sanitized output so you can inspect the shape of the result before touching a real system.

demo@lab:~$

$ cd restore-dr && cat required-files.txt

app/config.yml
app/orders.csv
app/secrets.env
bin/deploy.sh
public/index.html
uploads/avatar.txt

$ cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && find restore-sandbox/full -type f | sed 's#^restore-sandbox/full/##' | sort | comm -23 required-files.txt -

View reproducible demo details

These commands recreate the temporary example before running the command under review.

Reproduce this demo

  1. cd restore-dr && cat required-files.txt
  2. cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && find restore-sandbox/full -type f | sed 's#^restore-sandbox/full/##' | sort | comm -23 required-files.txt -

next steps

Related commands

Hosting Operations Deletes data

Extract a Backup Into a Restore Sandbox

A restore drill should write to a sandbox, not production.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full
Hosting Operations Deletes data

Verify Restored File Checksums

A restore is not validated until the bytes match.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && (cd restore-sandbox/full && sha256sum -c CHECKSUMS.sha256)
Hosting Operations Deletes data

Diff Restored Config Against Expected

A restored config can exist and still be the wrong config.

cd restore-dr && rm -rf restore-sandbox/full && mkdir -p restore-sandbox/full && tar -xf backups/2026-06-25/site.tar -C restore-sandbox/full && diff -u expected/app/config.yml restore-sandbox/full/app/config.yml
Hosting Operations Read-only

Find Missing Files in an Old Backup

The fastest failed restore drill is the one that finds missing critical files early.

cd restore-dr && tar -tf backups/2026-06-24/site.tar | sed 's#^./##' | sort | comm -23 required-files.txt -
Hosting Operations Read-only

List Archive Contents Before Extracting

You can inspect a tar backup before it writes a single file.

cd restore-dr && tar -tf backups/2026-06-25/site.tar | sed 's#^./##' | sort
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • linuxplus:troubleshooting
  • risk:production-state-change

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.