kbond / ZenstruckBackupBundle

Symfony2 Bundle that wraps backup commands
http://zenstruck.com/projects/ZenstruckBackupBundle
MIT License
17 stars 3 forks source link

Inital mockup for rotations created #3

Closed TheCelavi closed 9 years ago

kbond commented 9 years ago

I do like the system but I think we should leave the existing Destination interface as-is and add another interface called RotatingDestination which extends Destination:

  1. It doesn't make sense to have the S3CmdDestination rotatable.
  2. I think we should have a StreamDestination and a RotatingStreamDestination. It is my opinion that most use cases will not require rotation.
TheCelavi commented 9 years ago

Like! Even better!

Sent from my iPad

On Sep 8, 2015, at 5:20 PM, Kevin Bond notifications@github.com wrote:

I do like the system but I think we should leave the existing Destination interface as-is and add another interface called RotatingDestination which extends Destination:

It doesn't make sense to have the S3CmdDestination rotatable. I think we should have a StreamDestination and a RotatingStreamDestination. It is my opinion that most use cases will not require rotation. — Reply to this email directly or view it on GitHub.

kbond commented 9 years ago

The more I think about it, I don't even see a reason for a RotatingDestination interface.

kbond commented 9 years ago

I'm thinking all you need is:

RotatingDestination (abstract, implements Destination) RotatingStreamDestination (extends RotatingDestination)

TheCelavi commented 9 years ago

Ok, all done.

If everything is fine - I have to leave you with implementation of S3CmdDestination - I do not have account to test that... sorry :(

Now, do review, and notify me when I can start to mess around with factories and integration of rotators into service container.

Thanks for your time.

kbond commented 9 years ago

Looks good except for a few CS issues, duplicated code and cleanup. I try not using the else statement and nested for loops if I can avoid it.

kachkaev commented 9 years ago

Hi guys,

Am I right that this PR will eventually enable rotations of backups? My ultimate goal is to have hourly backups over the last day, daily backups over the last week and weekly backups for anything that's older. This means that the backup command will have to clean-up some archives that exist at the destination (or each destination, if there are more than one).

Is this what's going to be possible? How soon are you planning to roll out the change?

I'm currently choosing between kbond/ZenstruckBackupBundle and dizda/CloudBackupBundle, your answer will help a lot with the decision.

kbond commented 9 years ago

@kachkaev I believe this PR will enable what you desire. @TheCelavi would be able to better answer though.

kbond commented 9 years ago

@TheCelavi I am in the process of moving the backup specific stuff to it's own repo (https://github.com/kbond/php-backup). When I have some time, I can try my hand at migrating what you have done here over.

TheCelavi commented 9 years ago

Hi, I am sorry, I have some much stuff on my plate right now so I am not in the position to dedicate the time to this topic right now, sorry. :(

TheCelavi commented 9 years ago

You have the code, so if you want you can adjust it to your needs, I am going to close the PR since I do not have time right now to handle it.