SI Learning
0% read · Practice is tracked separately
← My learning
Version 1 · Chapter 24Reading mode

Final project: ship a verified operations report

Build a small operations report from an intentionally simple log. Your deliverable is a report, an archive, and evidence that the restored report matches. This brings together paths, quoting, filters, permissions, archives, and verification without requiring a server or administrator access.

The brief

Your team has a log with a severity and service name on each line. Count ERROR records by service, save the result, package the evidence, and prove the package can be restored. Use a new temporary directory.

Acceptance criteria

  • The report counts api twice and worker once.
  • INFO and WARN records are excluded.
  • The source log and report are included in the archive.
  • The original report is readable and writable only by its owner.
  • A byte comparison confirms the restored report matches.
  • You explain each pipeline stage and its limitations.

Start with the fixture

bash
si_lab=$(mktemp -d)
cd "$si_lab" || exit
printf '%s\n' 'INFO api ready' 'ERROR api timeout' 'ERROR worker retry' 'WARN web slow' 'ERROR api timeout' > events.log
cat events.log

Plan before looking at the example

Choose a filter, a field extractor, a grouping operation, and an archive command. Predict the report before you run anything. Then use the worked example to compare your approach.

Stretch task: Add an ERROR web record and regenerate the report. Explain why it now has a third service. If records contained quoted fields or structured JSON, choose an appropriate parser rather than stretching this whitespace-based pipeline.

Keep the useful habits

  • Inspect the current path and target before a write.
  • Bound output and network requests.
  • Read the installed manual when versions differ.
  • Verify a restore, not just the existence of an archive.
  • Report what you observed separately from what you inferred.

You now have a repeatable method for unfamiliar commands: identify the job, find the manual, preview the effect, and verify the result.

Source credit and license

Adapted from 101 Linux Commands by Bobby Iliev and contributors. The original command-topic collection is MIT licensed. SI's lesson structure, rewritten explanations, practice fixtures, and knowledge checks form this course adaptation. The supplied ebook's affiliate and promotional links are not included.

text
MIT License

Copyright (c) 2020 Bobby Iliev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

From raw records to trusted evidence

  1. Create a known fixture
  2. Filter and group errors
  3. Save a restricted report
  4. Archive and inspect
  5. Restore and compare

A worked example

Build and verify

Run this after creating the fixture above, in the same terminal.

bash
grep '^ERROR ' events.log | awk '{print $2}' | sort | uniq -c | sort -nr > report.txt
chmod 600 report.txt
cat report.txt
tar -czf evidence.tar.gz events.log report.txt
tar -tzf evidence.tar.gz
mkdir restored
tar -xzf evidence.tar.gz -C restored
cmp report.txt restored/report.txt
printf 'Restore comparison status: %s\n' "$?"

Expected result: api has 2 errors and worker has 1. The archive lists two files. cmp is silent and the comparison status is 0. The command chain assumes the fixture's simple whitespace-separated format; it is not a general-purpose log parser.

Read further

Apply what you learned

Your private practice

What best demonstrates that your operations report survived the archive and restore?

Answers are private. Completion requires the correct knowledge-check answer and a written response when an activity is included.

Restore a downloaded workbook

Choose a recovery file for this course and version. Review the recovered copy before saving it to your account.

Ask a question or report a problem

Describe what needs attention. Your private answer is shared only if you select the option below.

All learning paths
SI CENTRALIZATION · LEARN

Linux Command Line: from first command to confident practice

24 chapters · Your own pace

0 of 24 chapters complete