Hosting Operations
Read-onlyReview Critical File Modes in the Archive
You need to inspect critical file modes inside the backup archive before trusting a restore.
Command
BACKUP_ROOT=/srv/backups/site && tar -tvf "$BACKUP_ROOT/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 paste raw archive listings into tickets, chat, public logs, or screenshots without review. They may reveal paths, owners, permissions, and sensitive filenames such as secrets.
Expected output
Mode strings for app/secrets.env and bin/deploy.sh. Treat this output as sensitive until you have reviewed the filenames and metadata.
System impact
Read-only. Nothing changes on disk. The command reads archive metadata, but the listing can expose internal paths, owners, permissions, and sensitive filenames.
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 paste raw archive listings into tickets, chat, public logs, or screenshots without review. They may reveal paths, owners, permissions, and sensitive filenames such as secrets.
next steps
Related commands
Find Missing Files in an Old Backup
The fastest failed restore drill is the one that finds missing critical files early.
BACKUP_ROOT=/srv/backups/site REQUIRED=/srv/backups/site/required-files.txt && tar -tf "$BACKUP_ROOT/2026-06-24/site.tar" | sed 's#^./##' | sort | comm -23 "$REQUIRED" -
List Archive Contents Before Extracting
You can inspect a tar backup before it writes a single file.
BACKUP_ROOT=/srv/backups/site && tar -tf "$BACKUP_ROOT/2026-06-25/site.tar" | sed 's#^./##' | sort
Verify Restored File Checksums
A restore is not validated until the bytes match.
BACKUP_ROOT=/srv/backups/site RESTORE_SANDBOX=/tmp/linuxoneliners-restore/full && rm -rf "$RESTORE_SANDBOX" && mkdir -p "$RESTORE_SANDBOX" && tar -xf "$BACKUP_ROOT/2026-06-25/site.tar" -C "$RESTORE_SANDBOX" && (cd "$RESTORE_SANDBOX" && sha256sum -c CHECKSUMS.sha256)
Diff Restored Config Against Expected
A restored config can exist and still be the wrong config.
BACKUP_ROOT=/srv/backups/site EXPECTED_CONFIG=/srv/backups/site/expected/app/config.yml RESTORE_SANDBOX=/tmp/linuxoneliners-restore/full && rm -rf "$RESTORE_SANDBOX" && mkdir -p "$RESTORE_SANDBOX" && tar -xf "$BACKUP_ROOT/2026-06-25/site.tar" -C "$RESTORE_SANDBOX" && diff -u "$EXPECTED_CONFIG" "$RESTORE_SANDBOX/app/config.yml"
Extract a Backup Into a Restore Sandbox
A restore drill should write to a sandbox, not production.
BACKUP_ROOT=/srv/backups/site RESTORE_SANDBOX=/tmp/linuxoneliners-restore/full && rm -rf "$RESTORE_SANDBOX" && mkdir -p "$RESTORE_SANDBOX" && tar -xf "$BACKUP_ROOT/2026-06-25/site.tar" -C "$RESTORE_SANDBOX"
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.