Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add DB Backup Script #692

wants to merge 1 commit into from

Conversation

leibylucw
Copy link
Contributor

@leibylucw leibylucw commented Dec 11, 2023

Improves Coyote prod's backup strategy by adding a script to export database dumps to an S3 bucket at regular intervals, via SnapShooter.

@leibylucw leibylucw requested a review from jscholes December 11, 2023 16:44
@leibylucw leibylucw marked this pull request as ready for review December 11, 2023 16:45
current_date=$(date +%m_%d_%Y)

# Set the file name pattern
file_name="coyote_db_${current_date}.sql"
Copy link
Contributor

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"
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants