Rename backup_exclude to backup_exclude.txt

Fixes #64
This commit is contained in:
Erik Westrup
2022-02-01 16:52:17 +01:00
parent 687111fddf
commit 4e8b8adff6
5 changed files with 8 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Assertion on all needed envionment variables in the backup and check scripts.
### Changed
- **BREAKING CHANGE** renamed `/etc/restic/backup_exclude` to `/etc/restic/backup_exclude.txt` and ditto for `<backup-dest>/.backup_exclude` to `<backup-dest>/.backup_exclude.txt`.
- Align terminology used in README with the one used by B2 for credentials (keyId + applicationKey pair).
## [2.0.0] - 2022-02-01

View File

@@ -44,7 +44,7 @@ Note, you can use any of the supported [storage backends](https://restic.readthe
* `/etc/restic/pw.txt` - Contains the password (single line) to be used by restic to encrypt the repository files. Should be different than your B2 password!
* `/etc/restic/_global.env` - Global environment variables.
* `/etc/restic/default.env` - Profile specific environment variables (multiple profiles can be defined by copying to `/etc/restic/something.env`).
* `/etc/restic/backup_exclude` - List of file patterns to ignore. This will trim down your backup size and the speed of the backup a lot when done properly!
* `/etc/restic/backup_exclude.txt` - List of file patterns to ignore. This will trim down your backup size and the speed of the backup a lot when done properly!
1. Initialize remote repo as described [below](#3-initialize-remote-repo)
1. Configure [how often](https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events) back up should be made.
* Edit if needed `OnCalendar` in `/etc/systemd/system/restic-check@.timer`.
@@ -124,8 +124,8 @@ Put this file in `/usr/local/sbin`:
* `restic_backup.sh`: A script that defines how to run the backup. The intention is that you should not need to edit this script yourself, but be able to control everything from the `*.env` profiles.
Restic support exclude files. They list file pattern paths to exclude from you backups, files that just occupy storage space, backup-time, network and money. `restic_backup.sh` allows for a few different exclude files.
* `/etc/restic/backup_exclude` - global exclude list. You can use only this one if your setup is easy. This is set in `_global.env`. If you need a different file for another profile, you can override the envvar `RESTIC_BACKUP_EXCLUDE_FILE` in this profile.
* `.backup_exclude` per backup path. If you have e.g. an USB disk mounted at /mnt/media and this path is included in the `$BACKUP_PATHS`, you can place a file `/mnt/media/.backup_exclude` and it will automatically picked up. The nice thing about this is that the backup paths are self-contained in terms of what they shoud exclude!
* `/etc/restic/backup_exclude.txt` - global exclude list. You can use only this one if your setup is easy. This is set in `_global.env`. If you need a different file for another profile, you can override the envvar `RESTIC_BACKUP_EXCLUDE_FILE` in this profile.
* `.backup_exclude.txt` per backup path. If you have e.g. an USB disk mounted at /mnt/media and this path is included in the `$BACKUP_PATHS`, you can place a file `/mnt/media/.backup_exclude.txt` and it will automatically picked up. The nice thing about this is that the backup paths are self-contained in terms of what they shoud exclude!
## 5. Make first backup
Now see if the backup itself works, by running as root

View File

@@ -10,7 +10,7 @@
# The restic repository encryption key
export RESTIC_PASSWORD_FILE="/etc/restic/pw.txt"
# The global restic exclude file
export RESTIC_BACKUP_EXCLUDE_FILE="/etc/restic/backup_exclude"
export RESTIC_BACKUP_EXCLUDE_FILE="/etc/restic/backup_exclude.txt"
# Backblaze B2 credentials keyID & applicationKey pair.
# Restic environment variables are documented at https://restic.readthedocs.io/en/latest/040_backup.html#environment-variables

View File

@@ -47,10 +47,10 @@ trap exit_hook INT TERM
## Global backup configuration.
exclusion_args="--exclude-file ${RESTIC_BACKUP_EXCLUDE_FILE}"
## Self-contained backup files per backup path. E.g. having an USB disk at /mnt/media in BACKUP_PATHS,
# a file /mnt/media/.backup_exclude will automatically be detected and used:
# a file /mnt/media/.backup_exclude.txt will automatically be detected and used:
for backup_path in ${BACKUP_PATHS[@]}; do
if [ -f "$backup_path/.backup_exclude" ]; then
exclusion_args+=" --exclude-file $backup_path/.backup_exclude"
if [ -f "$backup_path/.backup_exclude.txt" ]; then
exclusion_args+=" --exclude-file $backup_path/.backup_exclude.txt"
fi
done