Automated backup scripts using Borg Backup, systemd and optionally Nextcloud/ownCloud/STACK.
This will backup the source files and folders of your choice to a Borg repository of your choice and optionally synchronize the repository with one of your cloud storage locations (based on Nextcloud, ownCloud or STACK. You can (and should) run it daily and for now it will keep 7 daily, 4 weekly, 12 monthly and unlimited yearly archives of your source files.
For Arch Linux, an installation package is available in the AUR which includes all needed dependencies.
Please also check and install the optional dependencies for more functionality
For a manual installation:
- Install
borg
on your system - Copy
luky-borg-backup.conf
to folder/etc
.This should only be done the first time
- Copy
luky-borg-backup.service
andluky-borg-backup.timer
to folder/etc/systemd/system
or/usr/lib/systemd/system
. - Copy
luky-borg-backup
to folder/usr/bin
File /etc/luky-borg-backup.conf
contains all configuration options of the backup script.
The file is rather self-explanatory, but here are some hints:
- At least
REPOSITORY
andSOURCES
should be defined. - To prevent manual intervention for filling in your repository password interactively, you can define
BORG_PASSPHRASE
.
Of course, prior to using luky-borg-backup
for the REPOSITORY
as defined in /etc/luky-borg-backup.conf
, you should setup the repository by i.e.:
borg init -e keyfile <repository>
To run the script every night at 04:00, you can enable and start the related timer by:
systemctl enable luky-borg-backup.timer
systemctl start luky-borg-backup.timer