~talfus-laddus/backup

BorgBackup Scripts
update deprecated option & add notify-send command
improved date printing during logging

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~talfus-laddus/backup
read/write
git@git.sr.ht:~talfus-laddus/backup

You can also use your local clone with git send-email.

#BorgBackup Scripts

  • [ ] Use PATTERNFILE from borg instead of custom path text file

#Setup

Before a backup can be made a repository has to be initialized (https://borgbackup.readthedocs.io/en/stable/quickstart.html):

borg init --encryption=repokey /path/to/repo

#Config

Example config env file containing Borg environment variables (config.env):

BORG_REPO=ssh://username@example.com:2022/~/path/to/repo
BORG_PASSPHRASE='XYZl0ngandsecurepa_55_phrasea&&123'
# export BORG_PASSCOMMAND='pass show borgbackup-passphrase'
# This has to be set when the repository has been created by user and the script is called by cron
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes

Example text file containing paths (paths.txt):

/some/absolute/path
/any/absolute/path

Example text file containing paths to exclude (exclude.txt):

home/*/.cache/*
home/*/venv/*

#Usage

# Backup
./backup.sh -c config.env -p paths.txt -e exclude.txt

# Restore latest backup
./restore -c config.env