Make backup script more robust

This commit is contained in:
Ske 2019-07-21 01:05:09 +02:00
parent 5118a17b84
commit a674b98c80

View File

@ -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