Remove stale locks before backing up
This commit is contained in:
parent
8b0b900375
commit
d3ee28fe56
@ -54,7 +54,19 @@ backup() {
|
|||||||
for dir in "$@"; do
|
for dir in "$@"; do
|
||||||
echo "- $dir"
|
echo "- $dir"
|
||||||
done
|
done
|
||||||
|
# First, we remove stale locks. This command will only remove locks that have not been
|
||||||
|
# updated in the last half hour. By default, restic updates them during an ongoing
|
||||||
|
# operation every 5 minutes, so this should be perfectly fine to do.
|
||||||
|
# What I'm not sure of (but should be fine because we auto-restart if need be) is if two
|
||||||
|
# processes doing this concurrently will cause issues. I'd hope not but you never know.
|
||||||
|
# restic-unlock(1)
|
||||||
|
/opt/restic-wrapper \
|
||||||
|
--verbose \
|
||||||
|
unlock
|
||||||
# Back up everything in the $DIRS array (which was passed as args)
|
# Back up everything in the $DIRS array (which was passed as args)
|
||||||
|
# This results in some level of pollution with regard to what paths are backed up
|
||||||
|
# (especially on ostree systems where we do the etc diff) but that's syntactic and
|
||||||
|
# we can script around it.
|
||||||
/opt/restic-wrapper \
|
/opt/restic-wrapper \
|
||||||
--verbose \
|
--verbose \
|
||||||
backup \
|
backup \
|
||||||
@ -65,11 +77,12 @@ backup() {
|
|||||||
# --keep-weekly n Keeps weekly backups for the last n weeks
|
# --keep-weekly n Keeps weekly backups for the last n weeks
|
||||||
# --keep-montly n Keeps monthly backups for the last n months
|
# --keep-montly n Keeps monthly backups for the last n months
|
||||||
# --keep-tag foo Keeps all snapshots tagged with "foo"
|
# --keep-tag foo Keeps all snapshots tagged with "foo"
|
||||||
# --host "$HOSTNAME" Only act on *our* snapshots. We don't care about other machines'
|
# --host "$HOSTNAME" Only act on *our* snapshots. We assume other machines are taking
|
||||||
|
# care of their own houses.
|
||||||
# --prune Remove orphaned blobs when we remove snapshots
|
# --prune Remove orphaned blobs when we remove snapshots
|
||||||
/opt/restic-wrapper \
|
/opt/restic-wrapper \
|
||||||
forget \
|
|
||||||
--verbose \
|
--verbose \
|
||||||
|
forget \
|
||||||
--keep-daily 7 \
|
--keep-daily 7 \
|
||||||
--keep-weekly 4 \
|
--keep-weekly 4 \
|
||||||
--keep-monthly 6 \
|
--keep-monthly 6 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user