-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
litestram - restore and replicate scripts, replicate before new deploy
- Loading branch information
Showing
6 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env zsh | ||
|
||
export GOOGLE_APPLICATION_CREDENTIALS="${HOME}/.config/gcloud/application_default_credentials.json" | ||
|
||
echo "" | ||
echo "###################################################################################################" | ||
echo "" | ||
echo "replicate.sh - Replicating the production db to Digial Ocean via Litestream" | ||
echo "" | ||
|
||
rm -rf litestream/dbs | ||
mkdir -p litestream/dbs | ||
touch litestream/dbs/.keep | ||
|
||
gsutil cp gs://sway-sqlite/production.sqlite3 litestream/dbs/production.sqlite3 | ||
|
||
litestream replicate -exec "sleep 10" -config litestream/config/replicate.yml | ||
|
||
rm -rf litestream/dbs | ||
mkdir -p litestream/dbs | ||
touch litestream/dbs/.keep | ||
|
||
echo "" | ||
echo "replicate.sh - Finished replicating the production db to Digial Ocean via Litestream" | ||
echo "" | ||
echo "###################################################################################################" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
#!/usr/bin/env zsh | ||
|
||
litestream restore -config litestream/config/litestream.yml ./storage/production.db | ||
echo "" | ||
echo "###################################################################################################" | ||
echo "" | ||
echo "restore.sh - Restoring the production db from Digial Ocean via Litestream to storage/production.db" | ||
echo "" | ||
|
||
litestream restore -config litestream/config/restore.yml storage/production.db | ||
|
||
echo "" | ||
echo "restore.sh - Finished restoring the production db from Digial Ocean via Litestream to stroage/production.db" | ||
echo "" | ||
echo "###################################################################################################" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters