Back to commands

Hosting Operations

Read-only

Review Critical File Modes in the Archive

You need to inspect critical file modes inside the backup archive before trusting a restore.

Command

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

Before you run this

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

When not to use it: Do not print sensitive file names from real systems into public logs without review.

Expected output

Mode strings for app/secrets.env and bin/deploy.sh.

System impact

Read-only. Nothing changes. The command reads archive metadata.

Recovery / rollback: no state is changed.

When to use it

Use during DR validation to confirm important modes are preserved.

When not to use it

Do not print sensitive file names from real systems into public logs without review.

Watch this command run

Command transcript

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

demo@lab:~$

$ cd restore-dr && tar -tvf backups/2026-06-25/site.tar | sed -n '1,12p'

drwxr-xr-x 0/0               0 2026-06-25 12:00 ./
-rw-r--r-- 0/0             493 2026-06-25 12:00 ./CHECKSUMS.sha256
drwxr-xr-x 0/0               0 2026-06-25 12:00 ./app/
-rw-r--r-- 0/0              48 2026-06-25 12:00 ./app/config.yml
-rw-r--r-- 0/0              41 2026-06-25 12:00 ./app/orders.csv
-rw-r----- 0/0              83 2026-06-25 12:00 ./app/secrets.env
drwxr-xr-x 0/0               0 2026-06-25 12:00 ./bin/
-rwxr-xr-x 0/0              32 2026-06-25 12:00 ./bin/deploy.sh
drwxr-xr-x 0/0               0 2026-06-25 12:00 ./public/
-rw-r--r-- 0/0              40 2026-06-25 12:00 ./public/index.html
drwxr-xr-x 0/0               0 2026-06-25 12:00 ./uploads/
-rw-r--r-- 0/0              18 2026-06-25 12:00 ./uploads/avatar.txt

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

-rw-r----- ./app/secrets.env
-rwxr-xr-x ./bin/deploy.sh
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. cd restore-dr && tar -tvf backups/2026-06-25/site.tar | sed -n '1,12p'
  2. cd restore-dr && tar -tvf backups/2026-06-25/site.tar | awk '/secrets.env|deploy.sh/ {print $1, $6}'

next steps

Related commands

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
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
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.