Add basic backup shell scripts

This commit is contained in:
Ske 2018-10-11 11:54:04 +02:00
parent a866b7cb4c
commit 31322f3fea
2 changed files with 11 additions and 0 deletions

3
scripts/dump-db.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
docker-compose -f "$(dirname $0)/../docker-compose.yml" exec -u postgres db pg_dump postgres

8
scripts/rclone-db.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Usage: rclone-db.sh <remote>:<path>
# 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