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

Generate daily, weekly and monthly backups #67

Closed
lowerends opened this issue Feb 3, 2016 · 9 comments
Closed

Generate daily, weekly and monthly backups #67

lowerends opened this issue Feb 3, 2016 · 9 comments

Comments

@lowerends
Copy link

I'd like to know if it would be useful to have the ability to generate and keep daily backups for the last, say, 30 days, and weekly backups for the last 12 weeks and monthly backups for the last 12 months. Of course these numbers should be configurable.

This would allow for less backup storage while still maintaining old backups. How would you guys feel about this and how would you approach this?

@freekmurze
Copy link
Member

This is a good idea for v3 of the package. ETA: somewhere in March. If it's not part of v3.0, I'll add it in a point release.

@lowerends
Copy link
Author

Great news also! I'll leave this open to discuss any possible ins and outs in the meanwhile.

@freekmurze
Copy link
Member

I'm looking for a good name for this functionality (keep daily backups for the last, say, 30 days, and weekly backups for the last 12 weeks and monthly backups for the last 12 months). Does that strategy have a specific name?

@lowerends
Copy link
Author

Well, I think the word "strategy" is the name for this functionality. I'm not sure how you will implement this, but I was thinking something with daily, weekly, monthly and yearly folders that would each get their own removal frequency and number of backups to keep.
Depending on how flexible this will be in terms of number and duration of backups to keep per time frame, you could call this feature "Configure your own backup strategy", or "backup strategy" in short.

@freekmurze
Copy link
Member

Lots of interesting ideas there. Thanks!

@freekmurze
Copy link
Member

I coded up the strategy:
https://github.com/spatie/laravel-backup/blob/v3/src/Tasks/Cleanup/Strategies/DefaultStrategy.php

Will probably refactor it in the coming days to make it more readable. Coming up with good function names is hard in this context.

And of course I'll write some tests to prove that it works :-)

@mrwaim
Copy link

mrwaim commented Feb 8, 2016

very cool. I would call it Backup Retention Policy

@freekmurze
Copy link
Member

It will be included in V3.0

@lowerends
Copy link
Author

Very nice, looking forward to it! 👍

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

No branches or pull requests

3 participants