Backup Firebase if needed

This commit is contained in:
2018-07-21 10:24:31 +02:00
parent 5a5aa908b8
commit a2a9431350

View File

@@ -27,4 +27,13 @@ ROUND="$(($(date +%_j) % 10))"
--exclude=bower_components \
"$HOME" |
gsutil cp - \
"gs://${BUCKET}/$(hostname)/$(whoami)/backup-$ROUND.tar"
"gs://$BUCKET/$(hostname)/$(whoami)/backup-$ROUND.tar"
if [ $# -eq 2 ]; then
PROJECT="$2"
# Also backup Firebase Database.
firebase --project="$PROJECT" database:get / | \
gzip | \
gsutil cp - \
"gs://$BUCKET/$PROJECT/firebase-database-$ROUND.gz"
fi