summaryrefslogtreecommitdiffstats
path: root/checkups.d
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-03-11 14:30:34 -0700
committerThomas Groman <tgroman@nuegia.net>2020-03-11 14:30:34 -0700
commit753ad76f5f32ace36a7686936b76caf296c7ff65 (patch)
treedc1c94387e370e362117eeda5c634ed383e3020e /checkups.d
downloadrestic_bootsrap-753ad76f5f32ace36a7686936b76caf296c7ff65.tar
restic_bootsrap-753ad76f5f32ace36a7686936b76caf296c7ff65.tar.gz
restic_bootsrap-753ad76f5f32ace36a7686936b76caf296c7ff65.tar.lz
restic_bootsrap-753ad76f5f32ace36a7686936b76caf296c7ff65.tar.xz
restic_bootsrap-753ad76f5f32ace36a7686936b76caf296c7ff65.zip
initial commit
Diffstat (limited to 'checkups.d')
-rwxr-xr-xcheckups.d/backblaze.sh35
-rwxr-xr-xcheckups.d/linode.sh35
2 files changed, 70 insertions, 0 deletions
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