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 a primitive backup rotation mechanism #53

Merged
merged 1 commit into from
Jun 30, 2024
Merged

Add a primitive backup rotation mechanism #53

merged 1 commit into from
Jun 30, 2024

Conversation

malor
Copy link
Member

@malor malor commented Jun 9, 2024

We have daily backups that periodically consume all available disk space. Currently, I clean up those files once in awhile using a Rust program I wrote back in the day, but I would like to make this part of a normal setup. We could use that Rust program, but it gets a bit annoying with building and shipping the binary. For something simple like this Python seems to be a better fit.

This updates the existing systemd unit to run the rotation script after each successful backup. Currently, in the dry run mode. Outside of dry run, the script will keep 30 most recent backups and delete the rest.

@malor malor force-pushed the rotate-backups branch from 564943b to 357118f Compare June 9, 2024 13:08
@malor malor requested a review from ikalnytskyi June 9, 2024 20:57
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
roles/postgres/files/rotate.py Outdated Show resolved Hide resolved
roles/postgres/files/rotate.py Outdated Show resolved Hide resolved
roles/postgres/files/rotate.py Outdated Show resolved Hide resolved
roles/postgres/files/rotate.py Outdated Show resolved Hide resolved
We have daily backups that periodically consume all available disk
space. Currently, I clean up those files once in awhile using a Rust
program I wrote back in the day, but I would like to make this part
of a normal setup. We _could_ use that Rust program, but it gets a
bit annoying with building and shipping the binary. For something
simple like this Python seems to be a better fit.

This updates the existing systemd unit to run the rotation script
after each successful backup. Currently, in the dry run mode. Outside
of dry run, the script will keep 30 most recent backups and delete the
rest.
@malor malor merged commit 7e11fcd into master Jun 30, 2024
3 checks passed
@malor malor deleted the rotate-backups branch June 30, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants