-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DB Backup Script #692
base: master
Are you sure you want to change the base?
Add DB Backup Script #692
Conversation
current_date=$(date +%m_%d_%Y) | ||
|
||
# Set the file name pattern | ||
file_name="coyote_db_${current_date}.sql" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thin coyote_prod
would be more helpful here, in case we do end up backing up other environments. Even if we don't, it's more explicit, and unambiguous is what you need while restoring a broken system.
file_name="coyote_db_${current_date}.sql" | ||
|
||
# Docker container name | ||
container_name="coyote_db_1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is orchestrated via Docker Compose, can we execute commands via compose too, and reference service names instead of container names? I don't want to rely on container names when service names can be considered more stable.
container_name="coyote_db_1" | ||
|
||
# Directory on the host where backups will be stored | ||
backup_dir=/root/db_backups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making this ~/db_backups
would be better; as to not unnecessarily leak details about our setup, and make it over-reliant on details that can change. In the future, maybe we could set the location as an env var.
Improves Coyote prod's backup strategy by adding a script to export database dumps to an S3 bucket at regular intervals, via SnapShooter.