Added exclude file for restic repo password

main
capntack 1 year ago
parent 5f7433997d
commit ea317e4ff3

@ -115,7 +115,11 @@ sudo chmod 600 /path/to/restic/password/.file
<br> <br>
10. Copy the script template to the script's root directory, rename as you like, and then fill out the variables the comments call out. Pay attention to where leading/trailing slashes are omitted. That is on purpose. I find it's best to use absolute paths, that way if you every move the script to a different directory, it won't break. A few notes and definitions above and beyond the comments in the script: 10. Copy the restic excludes template to the script's root directory, rename it as you like, and replace the `/path/to/restic/password/.file` line with the path to your restic password file. You can also add any other excludes you would like.
<br>
11. Copy the script template to the script's root directory, rename as you like, and then fill out the variables the comments call out. Pay attention to where leading/trailing slashes are omitted. That is on purpose. I find it's best to use absolute paths, that way if you every move the script to a different directory, it won't break. A few notes and definitions above and beyond the comments in the script:
a, The script dumps a log of its output into a directory of your choosing (the first variable in the script). There's a directory in script's root directory for that, but feel free to put them wherever you like. a, The script dumps a log of its output into a directory of your choosing (the first variable in the script). There's a directory in script's root directory for that, but feel free to put them wherever you like.
@ -141,7 +145,7 @@ sudo chmod 600 /path/to/restic/password/.file
<br> <br>
11. Make the script executable: 12. Make the script executable:
```bash ```bash
sudo chmod u+x /path/to/script.sh sudo chmod u+x /path/to/script.sh
@ -149,7 +153,7 @@ sudo chmod u+x /path/to/script.sh
<br> <br>
12. At this point, you can decide how you will run this script going forward. Whether just as you remember it (not very reliable), or set reminders for it (more reliable), or automate it in some way (best) like a crontab: 13. At this point, you can decide how you will run this script going forward. Whether just as you remember it (not very reliable), or set reminders for it (more reliable), or automate it in some way (best) like a crontab:
```bash ```bash
crontab -e crontab -e

@ -2,7 +2,7 @@
- Remove need for the timestamp.fix command - Remove need for the timestamp.fix command
- Add in SSH capability the rsync portion of the script - Add in SSH capability the rsync portion of the script
- Add in include/exclude files for restic - Add in include file for restic
- Add in capability for rsync to run more often than restic, all from the same script - Add in capability for rsync to run more often than restic, all from the same script
- Move variables to an external file - Move variables to an external file
- Script/code out all caches - Script/code out all caches

@ -48,6 +48,7 @@ readonly RESTIC_RETENTION_MONTHS_01="6"
readonly RESTIC_RETENTION_YEARS_01="1" readonly RESTIC_RETENTION_YEARS_01="1"
readonly RESTIC_TAG_01="tag01" readonly RESTIC_TAG_01="tag01"
readonly RESTIC_TAG_02="tag02" readonly RESTIC_TAG_02="tag02"
readonly RESTIC_EXCLUDES_01="/path/to/excludes/file-01"
# Restic Backup 02 Variables. Configure all accordingly. # Restic Backup 02 Variables. Configure all accordingly.
readonly RESTIC_PASSWORD_02="/path/to/restic/password/02.file" readonly RESTIC_PASSWORD_02="/path/to/restic/password/02.file"
@ -59,6 +60,7 @@ readonly RESTIC_RETENTION_MONTHS_02="6"
readonly RESTIC_RETENTION_YEARS_02="1" readonly RESTIC_RETENTION_YEARS_02="1"
readonly RESTIC_TAG_03="tag03" readonly RESTIC_TAG_03="tag03"
readonly RESTIC_TAG_04="tag04" readonly RESTIC_TAG_04="tag04"
readonly RESTIC_EXCLUDES_02="/path/to/excludes/file-02"
################### ###################
# RSYNC SCRIPT(S) # # RSYNC SCRIPT(S) #
@ -113,6 +115,7 @@ restic backup --verbose \
-r "${RESTIC_REPO_01}" \ -r "${RESTIC_REPO_01}" \
--tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \ --tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \
--exclude-caches \ --exclude-caches \
--exclude-file=$RESTIC_EXCLUDES_01
"${RESTIC_SOURCE_01}" "${RESTIC_SOURCE_01}"
# Now we forget snapshots and prune data for the same tags in the repo # Now we forget snapshots and prune data for the same tags in the repo
@ -135,6 +138,7 @@ restic backup --verbose \
-r "${RESTIC_REPO_02}" \ -r "${RESTIC_REPO_02}" \
--tag "${RESTIC_TAG_03}" --tag "${RESTIC_TAG_04}" \ --tag "${RESTIC_TAG_03}" --tag "${RESTIC_TAG_04}" \
--exclude-caches \ --exclude-caches \
--exclude-file=$RESTIC_EXCLUDES_02
"${RESTIC_SOURCE_02}" "${RESTIC_SOURCE_02}"
restic forget --prune --tag tag3,tag4 \ restic forget --prune --tag tag3,tag4 \

@ -0,0 +1,2 @@
# Exclude the .restic-password file
/path/to/restic/password/.file
Loading…
Cancel
Save