From a674b98c802569898309b63fd0ba332a8edfe27b Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 21 Jul 2019 01:05:09 +0200 Subject: [PATCH] Make backup script more robust --- scripts/rclone-db.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/rclone-db.sh b/scripts/rclone-db.sh index d15f0f44..6e4fda7c 100755 --- a/scripts/rclone-db.sh +++ b/scripts/rclone-db.sh @@ -4,4 +4,12 @@ # eg. rclone-db.sh b2:pluralkit FILENAME=pluralkit-$(date -u +"%Y-%m-%dT%H:%M:%S").sql.gz -$(dirname $0)/dump-db.sh | gzip | rclone rcat $1/$FILENAME + +echo Dumping database to /tmp/$FILENAME... +$(dirname $0)/dump-db.sh | gzip > /tmp/$FILENAME + +echo Transferring to remote $1... +rclone -P copy /tmp/$FILENAME $1 + +echo Cleaning up... +rm /tmp/$FILENAME \ No newline at end of file