How esl1h/vbackups works
Project Type & Purpose
• This is an open-source, command-line backup utility written in V (wrapped in a shell script), designed to:
• Read a YAML config (backups.yaml)
• Compress directories in parallel (pigz)
• Encrypt & sign archives (GPG)
• Send real-time notifications (ntfy.sh)
• Clean up temporary files and collect statistics
Main Components
a. V-Backup Script (vbackup.vsh / compiled V code)
b. Configuration (backups.yaml)
c. Local Compression Engine (tar + pigz)
d. Local Encryption Engine (GPG)
e. Notification Service (ntfy.sh)
f. Destination Storage (local filesystem directory)
g. Optional Scheduler (cron or systemd)
Relationships & Data Flows
• The Script reads the YAML config → iterates each backup item
• For each item:
• Calls tar+pigz → produces .tar.gz
• Calls GPG → produces .tar.gz.gpg
• Deletes the .tar.gz
• Updates in-memory statistics object
• After all items:
• Script issues HTTP POST to ntfy.sh with summary
• Script exits
• Scheduler (cron/systemd) triggers the script on a fixed schedule
Architectural Patterns
• Linear pipeline per item (Load → Compress → Encrypt → Clean)
• Modular external tool invocation (shell calls to tar/pigz/gpg/curl)
• Configuration-driven behavior (YAML)
• Single process, sequential loop, fault-tolerant via exit codes
a. Sketch a “Local Host” container. Inside it, place:
– “vbackup.vsh / V binary” (center)
– “tar + pigz” (to the right of script)
– “GPG” (right of compression)
– “Local Backup Directory” (destination, bottom of encryption)
b. Outside the Local Host, place:
– “Load config” (config → script)
– “Compress .tar.gz” (script → tar+pigz)
– “Encrypt & Sign” (tar+pigz → GPG)
– “Store .gpg” (GPG → Backup Directory)
– “Delete temp file” (script → indicates cleanup)
– “Send notification” (script → ntfy.sh)
– “Scheduled run” (Cron/systemd → script)