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 SQLite3 backup #463

Merged
merged 10 commits into from
Sep 13, 2024
Merged

Add SQLite3 backup #463

merged 10 commits into from
Sep 13, 2024

Conversation

n8maninger
Copy link
Member

@n8maninger n8maninger commented Sep 11, 2024

Adds an endpoint to backup a running hostd node to the local system. Can be used to schedule automatic atomic backups without shutting down the node or locking the database for a significant amount of time.

[POST] /api/system/sqlite3/backup

curl -u :"sia is cool" http://localhost:9980/api/system/sqlite3/backup -X POST -d '{ "path": "/backups/hostd.sqlite3.bak" }'

Copy link
Member

@ChrisSchinnerl ChrisSchinnerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good. Only thing I don't love is passing paths to a foreign filesystem through an endpoint but I guess that can't be avoided if we want to allow performing a backup through the UI.

api/endpoints.go Show resolved Hide resolved
persist/sqlite/store.go Show resolved Hide resolved
persist/sqlite/store.go Show resolved Hide resolved
@n8maninger n8maninger merged commit 573428f into master Sep 13, 2024
9 checks passed
@n8maninger n8maninger deleted the nate/add-db-backup branch September 13, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants