* Before, doing `$ PREFIX=/usr/local make install` would install files to`/usr/local/usr/local..` which is wrong * With this PR, files will be installed to the expected location e.g. `/usr/local/etc/restic` * `Makefile` almost completely rewritten * As e.g. `default.env` would source `_global.env`, `default.env` must be edited to find the right location of `_global.env` depending on what `$PREFIX` was set to. * see documented build stages in the `Makefile` itself. * Made sure that the rules are correct so that only modifed files are installed, not all at once unnecessarily like before. * A sub-goal was that the [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=restic-systemd-automatic-backup#n20) for Arch should not need to do any custom install configuration, to keep everything easier to maintain. `$ make install` should work out of the box for Arch. * Additionally added the `-b` flag to `install(1)` that makes a backup of existing `etc/restic/*` files before installing a newer version. Fixes #49
30 lines
1.3 KiB
Bash
30 lines
1.3 KiB
Bash
# Global envionment variables
|
|
# These variables are sourced FIRST, and any values inside of *.env files for
|
|
# specific configurations will override if also defined there.
|
|
|
|
|
|
# Official instructions on how to setup the restic variables for Backblaze B2 can be found at
|
|
# https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#backblaze-b2
|
|
|
|
|
|
# The restic repository encryption key
|
|
export RESTIC_PASSWORD_FILE="$INSTALL_PREFIX/etc/restic/pw.txt"
|
|
# The global restic exclude file
|
|
export RESTIC_BACKUP_EXCLUDE_FILE="$INSTALL_PREFIX/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
|
|
export B2_ACCOUNT_ID="<b2-key-id>" # *EDIT* fill with your keyID
|
|
export B2_ACCOUNT_KEY="<b2-application-key>" # *EDIT* fill with your applicationKey
|
|
|
|
# How many network connections to set up to B2. Default is 5.
|
|
export B2_CONNECTIONS=10
|
|
|
|
# Optional extra space-separated args to restic-backup.
|
|
# This is empty here and profiles can override this after sourcing this file.
|
|
export RESTIC_BACKUP_EXTRA_ARGS=
|
|
|
|
# Verbosity level from 0-3. 0 means no --verbose.
|
|
# Override this value in a profile if needed.
|
|
export RESTIC_VERBOSITY_LEVEL=0
|