Skip to content
Clairos Learn

Files and paths · Lesson 23 of 36 · 8 minutes

Restore drill

Restore into a review folder before touching live paths.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Junior operators build confidence by gathering evidence before changing systems.

cp
Copy a file to a new location, leaving the original in place.

Confirm the destination before replacing a file. This lab supports file copies, not every cp option.

diff
Compare two text files; a difference is a meaningful nonzero status, not necessarily an execution error.

Status 1 means differences for diff; shell status must be interpreted in command context.

stat
Inspect a file or directory metadata record, including ownership, permissions, and size.

Metadata and file contents answer different questions.

Worked example and expected result
$ cp /srv/www/index.html restore/index-copy.html
(no output; exit 0)

Exit status: 0. The command completed successfully in the training fixture.

$ diff /srv/www/index.html restore/index-copy.html
(no output; exit 0)

Exit status: 0. The command completed successfully in the training fixture.

$ stat restore/index-copy.html
Path: /home/learner/restore/index-copy.html
Type: file
Mode: -rw-r--r--
Owner: learner
Group: learners
Size: 72 bytes

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Restore drill”, which interpretation is safe?

Apply it elsewhere

Before adapting the diff workflow from “Restore drill” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Archive verificationTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Backup archive createCreate and list a small training backup archive.Practice
  2. 02Archive verificationList archive contents and compare checksums before trusting a backup.Practice
  3. 03Checksum compareHash source and restored files to confirm they match.Practice