sudo dnf install borgmatic
vi /etc/borgmatic/config.yaml
1. SOURCES & REPOSITORIES#
source_directories: - /
repositories: - path: /mnt/backup/behelit label: local
2. EXCLUDES#
one_file_system: true exclude_patterns: - /proc - /sys - /dev - /run - /tmp - /mnt - /media - /var/tmp - /var/cache - /var/lib/docker/overlay2 - /home/*/.cache
3. STORAGE SETTINGS#
encryption_passphrase: “YourSecretPassphraseHere” compression: zstd,3
4. RETENTION#
keep_daily: 7 keep_weekly: 4 keep_monthly: 6
5. CONSISTENCY CHECKS#
Fixed: The schema prefers a list of strings or a simpler object#
checks: - name: repository - name: archives
6. COMMANDS (Hooks)#
Fixed: Simplifying the ‘after’ and ‘on_error’ logic#
after_backup: - echo “Behelit Snapshot Created Successfully at $(date)”
on_error: - echo “Behelit Backup FAILED. Check logs with ‘journalctl -u borgmatic.service’”
sudo borgmatic config validate
initial backup#
sudo borgmatic create –verbosity 1 –list –stats
check after is finish#
sudo borgmatic check –verbosity 1
Enable the timer to start on boot and start it now#
sudo systemctl enable –now borgmatic.timer
sudo systemctl edit borgmatic.timer
[Timer]
This clears the default schedule#
OnCalendar=
This sets the new 3 AM schedule#
OnCalendar=--* 03:00:00
Adds a small random delay to prevent load spikes#
RandomizedDelaySec=10min
Ensure it runs if the PC was off at 3 AM#
Persistent=true