BorgBackup¶
BorgBackup (Borg) is a deduplicating archiver with compression and encryption.
Package Information¶
| Property | Value |
|---|---|
| Package Name | borgbackup |
| Upstream | borgbackup.org |
| License | BSD-3-Clause |
Included Tools¶
- borg - Main backup tool
- borgmatic - Configuration-driven backup wrapper
- emborg - Alternative Borg frontend
Installation¶
- Install BorgBackup from Package Center
- Initialize a repository
- Configure backups
Basic Usage¶
Initialize Repository¶
# Local repository
borg init --encryption=repokey /volume1/backup/borg-repo
# Remote repository
borg init --encryption=repokey user@remote:/path/to/repo
Create Backup¶
borg create /volume1/backup/borg-repo::backup-{now} \
/volume1/important \
--exclude '*.tmp' \
--compression lz4
List Archives¶
Restore Files¶
# Extract entire archive
borg extract /volume1/backup/borg-repo::backup-name
# Extract specific path
borg extract /volume1/backup/borg-repo::backup-name path/to/file
Prune Old Backups¶
Borgmatic¶
Borgmatic simplifies Borg with configuration files.
Configuration¶
Create /var/packages/borgbackup/var/borgmatic.yaml:
repositories:
- path: /volume1/backup/borg-repo
label: local
source_directories:
- /volume1/data
- /volume1/photos
exclude_patterns:
- '*.tmp'
- '**/cache'
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
compression: lz4
encryption_passphrase: "your-passphrase"
Run Borgmatic¶
Scheduling¶
Use DSM Task Scheduler:
- Control Panel → Task Scheduler
- Create → Scheduled Task → User-defined script
- Script:
/var/packages/borgbackup/target/env/bin/borgmatic
Troubleshooting¶
Repository Locked¶
Check Repository Health¶
Related Packages¶
- Restic - Alternative dedup backup
- rclone - Can sync Borg repos to cloud