📹 Watch the daemon running in real time
Untitled.design.2.mp4
This project is a production-style Python daemon that continuously monitors system resources while watching selected directories for filesystem activity. Whenever changes occur, it intelligently creates versioned ZIP backups, maintains backup history, and provides a command-line recovery interface.
The application demonstrates practical software engineering concepts including:
- Event-driven programming
- Background services
- Concurrent execution
- Filesystem monitoring
- Automated scheduling
- Logging
- Configuration management
- Fault-tolerant automation
| Feature | Description |
|---|---|
| 📊 System Monitoring | Real-time CPU, RAM and Disk monitoring |
| 👀 Filesystem Watchdog | Detects file creation, deletion, modification and rename events |
| ⚡ Event-driven Backups | Automatically creates backups after filesystem changes |
| ⏱ Scheduled Backups | Performs periodic full backups |
| 📦 Versioned Archives | Timestamped ZIP archives with automatic pruning |
| ♻️ Backup Recovery | Restore previous backups through CLI |
| 📝 Rotating Logs | Persistent structured logging with automatic rotation |
| ⚙️ Configurable | Easily customize thresholds, directories and schedules |
+------------------+
| daemon.py |
+---------+--------+
|
+---------------+---------------+
| |
| |
+---------v---------+ +---------v---------+
| System Monitor | | Watchdog Handler |
| CPU • RAM • Disk | | Filesystem Events |
+---------+---------+ +---------+---------+
| |
| |
+---------------+---------------+
|
+-------v--------+
| Backup Engine |
| ZIP Versioning |
+-------+--------+
|
+----------v----------+
| Backup Storage |
+----------+----------+
|
+---------v---------+
| Recovery CLI |
+-------------------+
system-backup-daemon/
│
├── daemon.py
├── backup_engine.py
├── watchdog_handler.py
├── system_monitor.py
├── scheduler.py
├── recovery_cli.py
├── logger_setup.py
├── config.py
├── requirements.txt
│
├── backups/
└── logs/
git clone https://github.com/USERNAME/system-backup-daemon.git
cd system-backup-daemon
pip install -r requirements.txtpython daemon.pyThe daemon starts monitoring immediately.
Modify config.py
WATCH_DIRS = [
"~/Documents",
"~/Desktop"
]
BACKUP_DIR = "./backups"
CPU_THRESHOLD_PCT = 85
RAM_THRESHOLD_PCT = 80
DISK_THRESHOLD_PCT = 90
MAX_VERSIONS_PER_DIR = 10List backups
python recovery_cli.py listRestore
python recovery_cli.py restore backup.zip ~/restoreInteractive mode
python recovery_cli.py interactive- Python
- psutil
- watchdog
- threading
- logging
- zipfile
- pathlib
- argparse
- Modular Software Architecture
- Event-Driven Programming
- Background Daemons
- Concurrent Processing
- Filesystem Monitoring
- Logging & Observability
- Configuration Management
- CLI Development
- Automated Scheduling
- Fault Tolerance
- Email notifications
- Cloud backup support
- Incremental backups
- Web dashboard
- Backup encryption
- Docker deployment
- GUI interface
MIT License