Backup Firebase if needed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user