aboutsummaryrefslogtreecommitdiff
path: root/op_guide/garage/backup.sh
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-22 17:46:19 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-22 17:46:19 +0100
commitb575b2b4862c4019a4ca5c9240ea5989f7a93b40 (patch)
treedfc5889c25a69d8ce3402539484a20d5af732db3 /op_guide/garage/backup.sh
parent015c3725326e635d58bd5ee1c30b95560ed45055 (diff)
downloadinfrastructure-b575b2b4862c4019a4ca5c9240ea5989f7a93b40.tar.gz
infrastructure-b575b2b4862c4019a4ca5c9240ea5989f7a93b40.zip
Remove all files from op_guide, now migrated to guide.deuxfleurs.fr
Diffstat (limited to 'op_guide/garage/backup.sh')
-rw-r--r--op_guide/garage/backup.sh65
1 files changed, 0 insertions, 65 deletions
diff --git a/op_guide/garage/backup.sh b/op_guide/garage/backup.sh
deleted file mode 100644
index 2ff18cd..0000000
--- a/op_guide/garage/backup.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-
-cd $(dirname $0)
-
-if [ "$(hostname)" != "io" ]; then
- echo "Please run this script on io"
- exit 1
-fi
-
-if [ ! -d "buckets" ]; then
- btrfs subvolume create $(pwd)/buckets
-fi
-
-
-AK=$1
-SK=$2
-
-function gctl {
- docker exec garage /garage $@
-}
-
-gctl status
-BUCKETS=$(gctl bucket list | tail -n +2 | cut -d " " -f 3 | cut -d "," -f 1)
-
-for BUCKET in $BUCKETS; do
- case $BUCKET in
- *backup*)
- echo "Skipping $BUCKET (not doing backup of backup)"
- ;;
- *cache*)
- echo "Skipping $BUCKET (not doing backup of cache)"
- ;;
- *)
- echo "Backing up $BUCKET"
-
- if [ ! -d $(pwd)/buckets/$BUCKET ]; then
- mkdir $(pwd)/buckets/$BUCKET
- fi
-
- gctl bucket allow --key $AK --read $BUCKET
- rclone sync --s3-endpoint http://localhost:3900 \
- --s3-access-key-id $AK \
- --s3-secret-access-key $SK \
- --s3-region garage \
- --s3-force-path-style \
- --transfers 32 \
- --fast-list \
- --stats-one-line \
- --stats 10s \
- --stats-log-level NOTICE \
- :s3:$BUCKET $(pwd)/buckets/$BUCKET
- ;;
- esac
-done
-
-# Remove duplicates
-#duperemove -dAr $(pwd)/buckets
-
-if [ ! -d "$(pwd)/snapshots" ]; then
- mkdir snapshots
-fi
-
-SNAPSHOT=$(pwd)/snapshots/buckets-$(date +%F)
-echo "Making snapshot: $SNAPSHOT"
-btrfs subvolume snapshot $(pwd)/buckets $SNAPSHOT