-
Notifications
You must be signed in to change notification settings - Fork 57
add several processors - handlers for file operations (tar, zip, 7z) #30
Conversation
add processors: tar, zip, 7z add options to config: date format, password, compression rate refactor BaseDatabase - move file operations to processor. In database handlers only dump operation now.
add processors: tar, zip, 7z add options to config: date format, password, compression rate refactor BaseDatabase - move file operations to processor. In database handlers only dump operation now. fix some bugs in previous commit
…or from command line
…structor to dump method
add several processors - handlers for file operations (tar, zip, 7z)
Wow! What a nice PR bro, thank you for your contribution ! It's all good to me ! |
Glad to code for you! :) |
I add date_format option for one purpose - user may set date_format at Y-m-w (week). And everyday backup will override yestarday backup - it will produce one backup per week - every week. And save disk size, needed for backups. |
For us * :) Ah indeed, I didn't knew that bundle was first in google :) Yes, setting the date is a good point, for those who wants to save only weeks or months backup ! |
Yes, you are right, deleting is a trouble, and with custom date format is more trouble.
$filename = date('Y-m') . '/' . $this->filePrefix . '_' . date($this->dateformat) . $this->getExtension(); First way is better, in my mind. And add to database a new field - level of backup (dayly/monthly/minor/major/mybestbackup/etc). This field will be pointed at the command line or in config (default level). By the way, creation of intermediate folders for backups may be a good idea. If I will make a backup every day, I will have more than 300 files in backup folder. And in few years of backuping I will have tons of files! |
Hmm there is maybe another solution bro.
Now we have that, we can get each files in the backup output directory and compare the "Last modified date" of files (http://php.net/manual/en/function.filemtime.php) And each files that are older than 2 weeks, will be deleted. What do you think? |
I thought about mtime, and I afraid that this don't work in all cases. Some filesystems may not support |
You're right! Or maybe we can store a file in the backup directory? This, avoid storing informations in a DB so it's means, avoid many adapters for all kind of database and table creation. |
self-maid meta info. Good idea. |
Lol yep, but it'll be stored locally, right ? |
Local or remote - not so important. What is important - consistence of this
|
👍 |
I think about one thing now. In present time adding of new storage is
|
What you mean? |
I say that some storages will be support purging, and some storages will be not. It is not necessary to do purge required in storage. |
reopen PR #29 - fix tests
I wanted to add password to archives. But tar command don't have internal possibility of encription, and I decided to add zip compression. The next step was create separate class for compression.
I refactored Database handlers, because file operations not linked with name of these classes (Mysql, MongoDB, Postgresql), in database class only dump operation remains.
I created Processor classes, which handle all file operations (copyFolders and compress).
In this classes I added password option and compression ratio for archivers.
In documentation I added section about choice of archiver - tar, zip or 7z.
And I fixed database tests and add new processor tests (and catch a bug :) tests rules! )