Back to commands

Hosting Operations

Read-only

Find Missing Files in an Old Backup

You need to compare a backup archive against a required file list and print required files that are absent.

Command

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

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not use it as checksum validation; it only checks required path presence.

Expected output

Required paths missing from the older backup, such as app/orders.csv and uploads/avatar.txt.

System impact

Read-only. Nothing changes. The command compares sorted file lists.

Recovery / rollback: no state is changed.

When to use it

Use during restore drills to catch incomplete backups before relying on them.

When not to use it

Do not use it as checksum validation; it only checks required path presence.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

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 && tar -tf backups/2026-06-24/site.tar | sed 's#^./##' | sort | comm -23 required-files.txt -

app/orders.csv
app/secrets.env
bin/deploy.sh
uploads/avatar.txt
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. cd restore-dr && cat required-files.txt
  2. cd restore-dr && tar -tf backups/2026-06-24/site.tar | sed 's#^./##' | sort | comm -23 required-files.txt -

next steps

Related commands

Hosting Operations Deletes data

Check Required Files After Restore

A successful extraction still needs a required-file check.

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 -
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
Hosting Operations Read-only

Review Critical File Modes in the Archive

Permissions are part of the restore, not decoration.

cd restore-dr && tar -tvf backups/2026-06-25/site.tar | awk '/secrets.env|deploy.sh/ {print $1, $6}'
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

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
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
  • risk:read-only

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.