Faborg (Fontivan Auto Borg) is a set of scripts to automate backups on Fedora systems using Btrfs snapshots and BorgBackup. It simplifies setup, backup, mounting, and maintenance of Borg repositories, with minimal manual intervention.
- Automated root SSH key and Borg key setup
- Secure upload of root SSH public key to NAS/backup server
- Local backup scripts installed for easy execution
- Systemd timer integration for scheduled backups
- Btrfs snapshot management with automatic cleanup
- Interactive mounting of Borg repositories for inspection
faborg/
├─ src/
│ └─ bin/
│ ├─ faborg-install.sh # Install/setup script
│ ├─ faborg-backup.sh # Backup execution script
│ └─ faborg-mount.sh # Mount a backup snapshot interactively
├─ etc/
│ └─ faborg/
│ ├─ .borg_keyfile # Borg passphrase file
│ ├─ faborg-backup.sh # Template backup script
│ ├─ faborg.service # Systemd service unit
│ ├─ faborg.timer # Systemd timer unit
│ └─ logrotate.conf # Log rotation for backups
└─ README.txt- Compatible Linux system (tested on Fedora 42+)
- Btrfs filesystem for snapshot support
- BorgBackup installed (sudo dnf install borgbackup)
- SSH access to a Borg/NAS server for backups
- User running the install script must have sudo access
-
It is assumed that a Borg server is already set up and available over the network.
-
Populate your secret configuration
echo "mysecretpassword" | sudo tee -a /root/.borg_keyfile
echo "borg@192.168.100.100:2222" | sudo tee -a /root/.borg_server- Run the install script
./src/bin/faborg-install.shThe script will:
- Validate the Borg server configuration
- Generate or reuse root SSH keys
- Install local backup scripts and systemd timer
- Copy the generated public key to your Borg server's sshkeys folder and save is using the system's hostname as the file name
This script assumes that / and /home are separate subvolumes, and that their snapshots are additionally stored in separate subvolumes /@root_snapshots and /home/@home_snapshots respectively.
The backup script must be run as root:
sudo /usr/local/bin/faborg-backup.shThe script handles:
- Create Btrfs snapshots for / and /home
- Push the snapshots to the Borg repository
- Prune old archives based on daily/weekly/monthly retention
- Delete local snapshots after a successful backup
Use the mount script to browse a specific backup snapshot:
sudo /usr/local/bin/faborg-mount.shThis script lists available backups interactively and mounts the selected backup under /mnt/borg.
When finished, unmount:
sudo borg umount /mnt/borgLogs are stored at /var/log/faborg.log.
The systemd timer also captures logs via:
journalctl -u faborg.timerAfter install, faborg.timer runs automatically to schedule backups.
Check timer status:
systemctl status faborg.timerManually trigger backup service:
systemctl start faborg.service- Root SSH keys and the Borg keyfile are stored under /root/.ssh/ and /root/.borg_keyfile.
- Always secure your .borg_keyfile — it is the encryption key for your backups.
- Fork the repository
- Make your changes in a branch
- Submit a pull request
See LICENSE file.