dizda / CloudBackupBundle

Be able to backup your database(s) and upload it to the cloud (Dropbox, Amazon S3, GoogleDrive, etc.)
MIT License
196 stars 57 forks source link

Added local client #69

Closed dafuer closed 8 years ago

dafuer commented 8 years ago

Hello,

Since 4th August the backup system does not work for me. The system is blocked for the problem in DropboxUploader. I understand the situation but a backup system is a critical system that should work always. I tried, like plan B, to use gaufrette to do local copies (in fact I have discovered that gaufrette has compatibility with Dropbox, I did not test yet) and first issue I found

  [Symfony\Component\Debug\Exception\OutOfMemoryException]                                     
  Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate XXXXX bytes)

I can split the files but for local storage is not best solution. I propose a really simple backup client which copy the backup files in a local folder (or mounted like local). In a way you can obtain same using gaufrette but this method don't need to use PHP memory since it will use copy function. In a way it is redundant but I like, it is a easiest backup system you can configure and once it is working you can improve it with gaufrette, dropboxuploader...

What do you think?

Cheers,

dizda commented 8 years ago

Hey @dafuer,

Sorry I was in vacations, didn't saw your PR!

You mean that Gaufrette store the file in memory while copying the file in the destination path? I agree with you, the local copy should not store the file in memory, then I can see two options:

  1. Merge your PR, then the local copy will be redundant with Gaufrette
  2. Fix the copy method on the Gaufrette library

Do you think the 2. is possible?

dafuer commented 8 years ago

Hi @dizda ,

I hope you have enjoyed your holidays ;)

Yes, gaufrette puts the content of the file in memory before copying it. I think it does it because it has an abstract layer to work with many different filesystems. I did not dive in the code of gaufrette but in my understanding, it works like this and it can not be changed. I could have a look to Gaufrette library but not now, I have overwork...

I agree with you about if you accept this PR the bundle will have a redundant local copy action. Currently, the bundle has a redundant Dropbox Copy (via gaufrette and dropbox uploader) and I don't see any problem on that. In fact, in a critical piece of code like this bundle I think to have alternatives is always good. For example, now dropbox uploader is not working and a lot of people is loosing the backups. (by the way, I'm in this list of users and I have in my task list check if gaufrette can work with dropbox better than dropbox-uploader script). If at some point gaufrette has problems (unlikely, it is true) we will have an alternative. Anyway, you have the last decision about it and if you think it is useful. Currently, I'm using it (like temporal solution until I can find a better solution) for now. I think it is a basic and robust solution that when everything fails, it will work. Do you think it does not provide anything new?

Cheers,

dizda commented 8 years ago

Ok that make sense, you convinced me.. ;) Can you just fix some typo that I've commented? Then I'll merge

dafuer commented 8 years ago

I'm glad to hear it :) I have done your proposed minor modifications. Are we ready for merge it?

dizda commented 8 years ago

Thanks for the PR man :)