GrzegorzBlok/FastRsyncNet

Compress directory and use fast rsync with the zipped folder file

Closed this issue · 4 comments

I would like to compress a whole folder and use fast rsync based on that zip file. I saw that you suggest to use the customized gzip API. Can you provide an example how to compress a whole folder with that? Or is that not possible?

FastRsyncNet.Compression provides gzip stream wrapper that compress a single stream of bytes. If you have a folder with a bunch of files you need to merge them into a single file first. Only after doing that you will be able to compress it. Typically you use some archive/packaging tool/library like tar archive.

I zipped the folder without compression, then use FastRsync on top of that file. The results are not really impressive. The delta file is pretty big, actually sometimes even bigger than when I directly zip the delta folder. Could it be that this approach is wrong?

Hi Thomas,

Sorry for the delayed response. To use rsync algorithm efficiently you need to make sure that whatever compression or archive method you use doesn't change order of the same blocks of data in subsequent runs. The zip method apparently doesn't work this way.

hm... ok. I expected that zipping without compression keeps the order. But maybe not. I'll try a different approach then.