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

Automatically delete old backup #1

Open
Surfict opened this issue Aug 26, 2020 · 1 comment
Open

Automatically delete old backup #1

Surfict opened this issue Aug 26, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Surfict
Copy link

Surfict commented Aug 26, 2020

Hello,

Is there a way to automatically delete old backups, like with the ENV VAR "REMOVE_BEFORE" that we can use with kartoza/docker-pg-backup ?

Thanks !

@justb4 justb4 added the enhancement New feature or request label Aug 26, 2020
@justb4
Copy link
Owner

justb4 commented Aug 26, 2020

No not yet. Would be a very useful feature. Though it has some danger: if somehow the backup is failing or empty without notice, one could end up with empty backups...Possibly a "verify" action would be useful first.

But anyways, this would not be too hard to implement, as the Python script is calling some Linux file commands already (like mkdir). There are oneliners to remove all dirs based on regexp:

https://unix.stackexchange.com/questions/389837/delete-sub-directories-with-yyyymmdd-in-name-older-than-n-days
So if the ENV VAR "REMOVE_BEFORE" is set this could be triggered after backup is done.

If you are able to make a PR, that would be welcome.

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

No branches or pull requests

2 participants