Linux Labs

Storage / Stage 9 of 11

The archive exists — now check the restore

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 7 · on a machine · 5 min

Comparing with the archive

Unpacking without errors does not mean the copy matches the archive. tar can compare them itself.

tar -df compares every archive member with the file on disk, relative to the -C directory: contents, mode, owner and modification time. If everything matches, it prints nothing. Here is the comparison for a copy someone edited by hand:

text
$ tar -df app-full.tar -C restore
tar: app/.release: Warning: Cannot stat: No such file or directory
app/bin/report.sh: Mode differs
app/config/app.conf: Mod time differs
app/config/app.conf: Size differs

Cannot stat means the file is missing, Mode differs means the mode changed, and Size differs with Mod time differs mean the contents changed. Extra files that are not in the archive go unnoticed by tar -df: you see them in ls -laR.

Exercise · do it

Restore from a differently shaped archive

The working copy live/app is broken again. Restore the application from the /srv/backup-lab/app-flat.tar archive into ~/backup-lab/restore/app: the configuration must end up in restore/app/config/app.conf and the other files next to it along their own paths, with hidden files and the modes from the archive. Leave live alone.

Sign in and start The machine is available after signing in

Goals · 0 of 1

  • Restore the application from app-flat.tar into restore/app not done yet

Step goals

0 of 1
  • Restore the application from app-flat.tar into restore/app — not done yet
Ubuntu 24.04

Step goals

0 of 1
  • Restore the application from app-flat.tar into restore/app — not done yet
Loading…