From 753ad76f5f32ace36a7686936b76caf296c7ff65 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Wed, 11 Mar 2020 14:30:34 -0700 Subject: initial commit --- checkups.d/backblaze.sh | 35 +++++++++++++++++++++++++++++++++++ checkups.d/linode.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100755 checkups.d/backblaze.sh create mode 100755 checkups.d/linode.sh (limited to 'checkups.d') diff --git a/checkups.d/backblaze.sh b/checkups.d/backblaze.sh new file mode 100755 index 0000000..9581082 --- /dev/null +++ b/checkups.d/backblaze.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# This script is used by the CRON Daemon to check backups for consistency +# and optionally integrity via the Restic backup utility + + +# Load restic variables +source /etc/restic.d/linode.conf + +# WARNING: Checking the backup integrity can be a costly procedure when using +# cloud data storage. This is because in order to verify integrity we must +# download the blobs and verify them. If the cloud storage provider charges +# more for download than upload (e.g, Cold Storage Plan) this can rack up +# expenses very quickly. +# +# Thankfully this does not need to be done very often BUT IT STILL NEEDS TO +# BE DONE. You wouldn't want to have your backups not working when you +# actually need to restore something would you? This does not normally need +# to be done very often, but if you would rather have the checks +# only perform consistency checking, not integrity checks you can remove +# the '--read-data' from the command. + +# NOTE: When repositories get fairly large checking them can generate large +# cache directories. It can also take a very long time to complete. Because +# of this we split the operation into 255 parts that run individually. + +# Check backup repository consistency (and integrity if --read-data is used) +counter=1 +while [ "$counter" -le 255 ] ; do + restic check \ + "$RESTIC_COMMON_OPTS" \ + --read-data-subset="$counter""/""255" \ + --read-data + ((counter++)) +done diff --git a/checkups.d/linode.sh b/checkups.d/linode.sh new file mode 100755 index 0000000..5bc4fbe --- /dev/null +++ b/checkups.d/linode.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# This script is used by the CRON Daemon to check backups for consistency +# and optionally integrity via the Restic backup utility + + +# Load restic variables +source /etc/restic.d/backblaze.conf + +# WARNING: Checking the backup integrity can be a costly procedure when using +# cloud data storage. This is because in order to verify integrity we must +# download the blobs and verify them. If the cloud storage provider charges +# more for download than upload (e.g, Cold Storage Plan) this can rack up +# expenses very quickly. +# +# Thankfully this does not need to be done very often BUT IT STILL NEEDS TO +# BE DONE. You wouldn't want to have your backups not working when you +# actually need to restore something would you? This does not normally need +# to be done very often, but if you would rather have the checks +# only perform consistency checking, not integrity checks you can remove +# the '--read-data' from the command. + +# NOTE: When repositories get fairly large checking them can generate large +# cache directories. It can also take a very long time to complete. Because +# of this we split the operation into 255 parts that run individually. + +# Check backup repository consistency (and integrity if --read-data is used) +counter=1 +while [ "$counter" -le 255 ] ; do + restic check \ + "$RESTIC_COMMON_OPTS" \ + --read-data-subset="$counter""/""255" \ + --read-data + ((counter++)) +done -- cgit v1.2.3