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
borgon your system - Copy
luky-borg-backup.confto folder/etc.This should only be done the first time
- Copy
luky-borg-backup.serviceandluky-borg-backup.timerto folder/etc/systemd/systemor/usr/lib/systemd/system. - Copy
luky-borg-backupto 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
REPOSITORYandSOURCESshould 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