🛡️ Shadow Sentinel
Autonomous OS-Level Revision & Backup Daemon with Decentralized Marker Control and Loop-Coupling.
Shadow Sentinel monitors directory trees in real-time via the Linux kernel (inotify), captures
atomic .bak revisions and unified diffs (.diff) on every file modification, and provides
instant 1-command restores with loop-coupling safety.
🚀 Key Features
-
Decentralized Marker Control (
sentinel_marker):- No tedious editing of central configuration files.
- Simply run
sentinel init [MB]in any directory or place asentinel_markerfile. - The daemon automatically scans the system on startup and binds all marked roots.
-
Dynamic File-Size Ceiling (Self-Pruning Vault):
- The value inside
sentinel_markersets the protected size ceiling (e.g.5for 5 MB). - If a file (such as a runaway logfile) exceeds this ceiling, it is automatically ejected from the shadow vault. Small scripts, configurations, and source code stay 100% protected.
- The value inside
-
Loop-Coupling (Undo-Safe Restore):
- Restoring a file with
sentinel restore <ID>overwrites the target file. - The running inotify daemon immediately intercepts this write and seals the overwritten version into a brand-new backup revision. Mistaken restores can instantly be undone!
- Restoring a file with
-
Flapping & Cooldown Debounce:
- Rapid consecutive writes are debounced with a 3-second quiet window to prevent spam.
-
Zero Dependencies:
- Pure Python standard library with native
ctypesbindings directly tolibc.so.6. - No external tools like
inotifywaitor background Git daemons required.
- Pure Python standard library with native
🧹 Automated Disk Sanitation & Retention Doctrine
Sentinel guarantees that it will never exhaust disk space through a 4-tier automated policy:
-
Version Cap per File (Max 10 Revisions): Only the 10 most recent
.bakand.difffiles per target are kept. Older versions are deleted. -
Version Age Expiration (14 Days): Revisions older than 14 days are automatically pruned.
-
Log Expiration (30 Days): Daily audit diff logs (
diff-YYYYMMDD.log) are removed after 30 days. -
Emergency Storage Ceiling (500 MB Cap): If total backup directory size exceeds 500 MB, an emergency purge trims the oldest backups across all files until total disk usage drops back down to 80% (400 MB).
-
Active Vault Ejection: Files that grow beyond the MB ceiling in
sentinel_markerare immediately removed from the.shadow_vaultto recover disk space instantly.
The pruning engine runs automatically every 6 hours and immediately upon service startup.
📦 Installation
pip install shadow-sentinel
Set up and start the systemd background service in one step:
sudo sentinel service install
🛠️ Usage
Protect a Directory
Navigate to the directory and run:
sentinel init 5
(Creates sentinel_marker with a 5 MB file size limit).
List Backups
Simply type in any terminal:
sentinel
Automatically detects the nearest marker upwards and lists all protected revisions.
Restore a File
sentinel restore 3
View Unified Diff
sentinel diff 3
List All Active Markers on System
sentinel markers
Full Interactive Manual
sentinel help
⚙️ Storage & Configuration
Linux FHS Standard Paths:
- Root Daemon:
/var/lib/shadow-sentinel/ - User Daemon:
~/.local/share/shadow-sentinel/
Custom Storage Redirection (/etc/shadow-sentinel/config.json):
To store backups, vaults, and indices in a custom directory, create:
/etc/shadow-sentinel/config.json (for root) or ~/.config/shadow-sentinel/config.json (for user):
{
"storage_dir": "/custom/path/to/backups"
}
Environment Variable Override:
export SENTINEL_STORAGE_DIR=/custom/path/to/backups
Metadata
Release files for shadow-sentinel 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| shadow_sentinel-1.0.1.tar.gz | 15.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shadow_sentinel-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.0 kB
Release files / shadow_sentinel-1.0.1.tar.gz
| Download URL | shadow_sentinel-1.0.1.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8caf16a1f828f5f9c24944664757804168b7eea732c1e9023cee8b0e89fe6fef
|
|
BLAKE2b-256 checksum How to use checksums |
05e1942ce0ab95f58d35685fa90f3d72c692fd66b259a57d212c18ea1cf3d158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / shadow_sentinel-1.0.1-py3-none-any.whl
| Download URL | shadow_sentinel-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d4bfd7fc638165d600bbe66c61f4cc885c5557172a1436981b75c3e02117dbe
|
|
BLAKE2b-256 checksum How to use checksums |
f6f2b7d8cc69dc726ef864b5cf283bb7b3b72a97f43ce12e38e2774bbe692e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for shadow-sentinel 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.