From 31322f3fea988277057250fbb515315822ea2b6a Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 11 Oct 2018 11:54:04 +0200 Subject: [PATCH] Add basic backup shell scripts --- scripts/dump-db.sh | 3 +++ scripts/rclone-db.sh | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100755 scripts/dump-db.sh create mode 100755 scripts/rclone-db.sh diff --git a/scripts/dump-db.sh b/scripts/dump-db.sh new file mode 100755 index 00000000..189d4aa7 --- /dev/null +++ b/scripts/dump-db.sh @@ -0,0 +1,3 @@ +#!/bin/sh +docker-compose -f "$(dirname $0)/../docker-compose.yml" exec -u postgres db pg_dump postgres + diff --git a/scripts/rclone-db.sh b/scripts/rclone-db.sh new file mode 100755 index 00000000..b9fa5689 --- /dev/null +++ b/scripts/rclone-db.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Usage: rclone-db.sh : +# eg. rclone-db.sh b2:pluralkit + +FILENAME=pluralkit-$(date +"%Y-%m-%dT%H:%M:%S").sql +$(dirname $0)/dump-db.sh | rclone rcat $1/$FILENAME +