Project 4: Automated Backup System with Timers
A complete backup solution using systemd timers: daily incremental backups, weekly full backups, log rotation, email notifications on failure, and a CLI to check backup status.
Quick Reference
| Attribute | Value |
|---|---|
| Primary Language | Bash |
| Alternative Languages | Python |
| Difficulty | Level 1: Beginner |
| Time Estimate | Weekend |
| Knowledge Area | System Administration |
| Tooling | Systemd Timers |
| Prerequisites | Basic shell scripting, familiarity with rsync or tar |
What You Will Build
A complete backup solution using systemd timers: daily incremental backups, weekly full backups, log rotation, email notifications on failure, and a CLI to check backup status.
Why It Matters
This project builds core skills that appear repeatedly in real-world systems and tooling.
Core Challenges
- Writing .timer units with OnCalendar expressions (maps to timer scheduling)
- Making timers persistent so missed runs execute on boot (maps to Persistent=true)
- Configuring OnFailure= to trigger notification services (maps to failure handling)
- Using systemd-analyze to verify timer scheduling (maps to debugging tools)
- Implementing RandomizedDelaySec to avoid thundering herd (maps to production patterns)
Key Concepts
- Timer units: `man systemd.timer`, systemd.time(7) for calendar syntax
- Backup strategies: “The Linux Command Line” Ch. 18 by William Shotts
- Shell scripting for backups: “Wicked Cool Shell Scripts” by Taylor & Perry
Real-World Outcome
Deliver a working demo with observable output that proves the feature is correct.
Implementation Guide
- Reproduce the simplest happy-path scenario.
- Build the smallest working version of the core feature.
- Add input validation and error handling.
- Add instrumentation/logging to confirm behavior.
- Refactor into clean modules with tests.
Milestones
- Milestone 1: Minimal working program that runs end-to-end.
- Milestone 2: Correct outputs for typical inputs.
- Milestone 3: Robust handling of edge cases.
- Milestone 4: Clean structure and documented usage.
Validation Checklist
- Output matches the real-world outcome example
- Handles invalid inputs safely
- Provides clear errors and exit codes
- Repeatable results across runs
References
- Main guide:
SYSTEMD_LEARNING_PROJECTS.md - “The Linux Command Line” by William Shotts