Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

Commit e120fb9

Browse files
committed
Update README.md, add example
1 parent 216f0cb commit e120fb9

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ zinc - the reverse-rsync
33

44
[![Build Status](https://travis-ci.org/rokups/zinc.svg?branch=master)](https://travis-ci.org/rokups/zinc)
55

6-
**WARNING:** This code is very immature, likely buggy and a subject to change. It would be great if it saw some testing
7-
from people other than me, however if you use it for anything serious and it breaks - you get to keep both pieces.
6+
**WARNING:** **DO NOT USE IT WITH IMPORTANT AND/OR NOT BACKED UP DATA**. This code is of beta quality. I am fairly
7+
certain it will not corrupt your data. Code was fuzz-tested for weeks without failures and is in use in a live
8+
environment with rather small (few hundred) users without issues. However, you never know.
89

910
rsync has become a synonym to efficient data synchronization. There are few issues however: server does heavy lifting
1011
and GPL license.
@@ -56,6 +57,34 @@ As you can see from diagram above process of synchronizing data is composed of t
5657
2. Delta calculation: Client obtains the list of block hashes, then calculates a rolling checksum on the local file. Using rolling checksum and list of remote file hashes algorithm determines what file parts need to be kept/copied/downloaded. Local file data will be reused as much as possible.
5758
3. Patching: Using a calculated delta map blocks in local file are rearranged much like a puzzle pieces, missing pieces are downloaded.
5859

60+
### Example
61+
62+
Project comes with a testing tool `zinc` which is used mainly for debugging. Tool is reading and writing local files.
63+
Example below was performed in tmpfs, ISO files were about 500MB and tested CPU was i7-6800K (6 core / 12 thread). Due
64+
to tmpfs you may consider test timing results as benchmark of core algorithm as file reading/writing basically happened
65+
in memory.
66+
```sh
67+
/tmp % # Test files are rather old Archliux ISOs
68+
/tmp % sha1sum archlinux-2017.0*.iso
69+
77508eaf2be9f15e22b1cc920db12d4e90c2cf77 archlinux-2017.06.01-x86_64.iso
70+
dd03d811211c332d29155069d8e4bb2306c70f33 archlinux-2017.07.01-x86_64.iso
71+
72+
/tmp % # Hash new ISO file. Produced json file is hosted on a remote (web)server along with the ISO
73+
/tmp % ./zinc --hash ./archlinux-2017.07.01-x86_64.iso ./archlinux-2017.07.01-x86_64.iso.json
74+
75+
/tmp % # Client system obtains json file with hashes from a remote server and finds different and matching blocks
76+
/tmp % # Client system then moves existing matching blocks to their new locations while downloading missing blocks from remote server
77+
/tmp % time ./zinc ./archlinux-2017.07.01-x86_64.iso ./archlinux-2017.06.01-x86_64.iso
78+
Calculating delta : [##################################################] 100.00
79+
Patching file : [##################################################] 100.00
80+
./zinc ./archlinux-2017.07.01-x86_64.iso 70.23s user 0.24s system 977% cpu 7.206 total
81+
82+
/tmp % # ISO was updated in less than a second
83+
/tmp % sha1sum archlinux-2017.0*.iso
84+
dd03d811211c332d29155069d8e4bb2306c70f33 archlinux-2017.06.01-x86_64.iso
85+
dd03d811211c332d29155069d8e4bb2306c70f33 archlinux-2017.07.01-x86_64.iso
86+
```
87+
5988
### Other similar software
6089
* [rsync](https://rsync.samba.org/) - inspiration of zinc
6190
* [zsync](http://zsync.moria.org.uk/) - inspiration of zinc

0 commit comments

Comments
 (0)