fixup
update deprecated option & add notify-send command
improved date printing during logging
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
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/*
# Backup
./backup.sh -c config.env -p paths.txt -e exclude.txt
# Restore latest backup
./restore -c config.env