Integrating Borgmatic into UNIT3D as the core backup function would provide a much needed upgrade over the existing zip-based method. Borg has features like snapshots, deduplication, and incremental backups, which conserves resources and significantly reduces storage space by only saving changes since the last backup, rather than duplicating entire datasets. It also has native encryption. For example, a 14GB site can maintain dozens of hourly, nightly, and monthly snapshots and restoration points for both site and database, using only a fraction of the space.
borgmatic rinfo
Archive fingerprint: dc03671cfdafasdfa8fasdfkla39423420239f56b45eb969cabb9c3b36f8ce88708
Comment:
Hostname: unit3d.local
Username: ubuntu
Time (start): Mon, 2024-04-08 12:00:05
Time (end): Mon, 2024-04-08 12:00:46
Duration: 21.52 seconds
Number of files: 143858
Command line: /usr/bin/borg create --exclude-from /tmp/tmp1x13ybwl --one-file-system --read-special --list --filter AME- --info --stats '/home/ubuntu/backups/unit3d.borg::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}' /home/ubuntu/.borgmatic /home/ubuntu/.config/borgmatic/config.yaml /var/www/html
Utilization of maximum supported archive size: 0%
------------------------------------------------------------------------------
Original size Compressed size Deduplicated size
This archive: 14.21 GB 10.69 GB 686.97 MB
All archives: 819.80 GB 617.86 GB 37.34 GB
Unique chunks Total chunks
Chunk index: 183684 8636948
The goal is to replace UNIT3D's existing backup system with a Borg-based one. This will introduce frontend functions for initiating backups, extracting/restoring files or directories, and performing database restorations, with configuration management and cronjobs handled in the backend.
~/.config/borgmatic/config.yaml
). Here's a working example being used for UNIT3D:encryption_passphrase: ${BORG_PASSPHRASE}
source_directories:
- /var/www/html
repositories:
- path: ssh://[email protected]:22/backup/unit3d.borg
label: offsite
- path: /var/www/html/storage/backups/unit3d.borg
label: local
keep_hourly: 24
keep_daily: 30
keep_weekly: 12
keep_monthly: 12
keep_yearly: 7
checks:
- name: repository
- name: archives
frequency: 2 weeks
exclude_patterns:
- /var/www/html/storage/backups
- /var/www/html/storage/app/backup-temp/
mysql_databases:
- name: unit3d
username: root
password: ${MYSQL_ROOT_PASSWORD}
format: sql
borgmatic rcreate --encryption repokey-aes-ocb
crontab -e
borgmatic --verbosity 1 --list --stats >> /var/www/html/storage/logs/unit3d_borgmatic/backup_now.log 2>&1
cat /var/www/html/storage/logs/four_times_daily.log
borgmatic rlist
borgmatic extract --archive latest
borgmatic extract --archive host-2023-01-02T04:06:07.080910
borgmatic extract --archive latest --path /var/www/html/public/files/torrents
borgmatic restore --archive latest
borgmatic restore --archive host-2023-01-02T04:06:07.080910
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too