-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple profile configuration #45
Merged
Merged
Changes from 12 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
765523c
moved env variables out into separate .env files, with inheritance fr…
mfeif e186cc3
oops; wrong way to declare env variable for $HOME
mfeif a006731
Merge remote-tracking branch 'origin/master' into multi-repo
gerardbosch 20705a0
Extract configuration to env profiles
gerardbosch f136bab
Merge remote-tracking branch 'origin/master' into multi-repo
gerardbosch 1be6878
Merge remote-tracking branch 'origin/master' into multi-repo
gerardbosch 53e246c
Add root note on README
gerardbosch 7a31380
Merge remote-tracking branch 'origin/master' into multi-repo
gerardbosch 13371f8
Align with the latest additions from master
gerardbosch 58ac90d
Test contribution to PR
erikw 3842699
Brush up documentation in .env files
erikw e534752
Fix .backup_exclude per backup path
erikw 9a889c9
Prepare CHANGELOG.md
erikw 80ed04c
Clarify PREFIX installation
erikw d4c7e56
Document in restic_*.sh how to run the scripts
erikw f9e44fb
Make TL;DR in README more concise
erikw d77c042
Correct comment about restic crashing
erikw 424bb0c
Find backup exlude files in home directores again
erikw a49f672
Explain how backup exclude files works in README
erikw 9eb647d
Fix spell
gerardbosch b6b7764
Update usr/local/sbin/restic_backup.sh
erikw 6c16b60
Update usr/local/sbin/restic_backup.sh
erikw 4675d99
Extract global exclude file into env RESTIC_BACKUP_EXCLUDE
gerardbosch 38f9d5e
Merge remote-tracking branch 'origin/multi-repo' into multi-repo
gerardbosch 47a6155
Align suggested function name with the call-site name
gerardbosch d689f80
Add sudo note on make install
gerardbosch 9c384bc
Fix exclusion args function return
gerardbosch 066f6f9
Fix duplicate exclusion argument entries
gerardbosch 2ba0864
Remove automatic /home/user\*/.backup_exclude feature
erikw ef41587
After removing the home exclusions feature, sort_unique became dead code
gerardbosch 1494871
README update suggestions from @mfeif
erikw e898fef
Fix URL sytnax
erikw cda0230
Random sleep on service execution
erikw 0a4475c
Notes on password setup
erikw c2c6e75
README note
erikw df411de
Replace bash RANDOM with simpler to read shuf(1)
erikw ccd769d
s/RESTIC_BACKUP_EXCLUDE/RESTIC_BACKUP_EXCLUDE_FILE/
erikw ce62520
PR feedback fixes in README
erikw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# Prevent check-in of these sensitive files. Instead they are generated from the corresponding *.template file. | ||
/etc/restic/b2_pw.txt | ||
/etc/restic/b2_env.sh | ||
etc/restic/pw.txt | ||
etc/restic/_global.env | ||
etc/restic/default.env | ||
|
||
# IntelliJ | ||
.idea/ | ||
*.iml | ||
# VSCode | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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="/etc/restic/pw.txt" | ||
|
||
# Backblaze B2 credentials | ||
export B2_ACCOUNT_ID="<b2-account-id>" # TODO fill with your account info | ||
export B2_ACCOUNT_KEY="<b2-account-key>" # TODO fill with your account info | ||
|
||
# How many network connections to set up to B2. Default is 5. | ||
export B2_CONNECTIONS=10 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This is the default profile. Fill it with your desired configuration. | ||
# Additionally, you can create and use more profiles by copying this file. | ||
|
||
# This file (and other .env files) has two purposes: | ||
# - being sourced by systemd timers to setup the backup before running restic_backup.sh | ||
# - being sourced in a user's shell to work directly with restic commands e.g. | ||
# $ source /etc/restic/default.env | ||
# $ restic snapshots | ||
# Thus you don't have to provide all the arguments like | ||
# $ restic --repo ... --password-file ... | ||
|
||
source /etc/restic/_global.env | ||
|
||
# Below envvar will override those in _global.env | ||
|
||
export RESTIC_REPOSITORY="b2:<b2-repo-name>" # TODO fill with your repo name | ||
|
||
# What to backup (paths our mountpoints) e.g. "/ /boot /home /mnt/media". | ||
# To backup only your home directory, set "/home/your-user" | ||
export BACKUP_PATHS="" # TODO fill conveniently with one or multiple paths | ||
|
||
# Example below of how to dynamically add a path that is mounted e.g. external USB disk. | ||
# restic will fail if a specified path is not mounted, thus we shoud only add it to BACKUP_PATHS if it is available. | ||
#test -d /mnt/media && BACKUP_PATHS+=" /mnt/media" | ||
|
||
# A tag to identify backup snapshots. | ||
export BACKUP_TAG=systemd.timer | ||
|
||
# Retention policy - How many backups to keep. | ||
# See https://restic.readthedocs.io/en/stable/060_forget.html?highlight=month#removing-snapshots-according-to-a-policy | ||
export RETENTION_DAYS=14 | ||
export RETENTION_WEEKS=16 | ||
export RETENTION_MONTHS=18 | ||
export RETENTION_YEARS=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<restic-encryption-password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question here: What will happen if
BACKUP_PATHS=/home/
and, then there is a/home/someuser/.backup_exclude
file? The file makes reference to a specific user, while the paths refer to the higher level directory/home
.The previous behaviour takes the
someuser
exclusion file in consideration, but after the change what will happen? I think it will be omitted, right? If that's right, may be confusing. What do you think? :DMaybe aside of
backup_paths/.backup_exclude
, also all user homedir.backup_exclude
can be considered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this was the original intention, got-cha! Thanks
I had forgotten. We should look for
.backup_exclude
for each mount-point, and additionally each user dir in/home
, if/home
is in the backup path.Will fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, please check 424bb0c
I tried it out locally, seemed to work... 😅