]> Sergey Matveev's repositories - syncer.git/blob - README
bf9f7032b2be5ad1bbc02052924e5248b1b89249
[syncer.git] / README
1 syncer -- Fast stateful file/disk data syncer.
2
3 DESCRIPTION
4
5 Main purpose of this utility is fast data synchronizing between two hard
6 drives: one is fast (SSD, SATA HDD), another is connected through slow
7 USB interface. Task is to lower amounts of data needed to be transferred.
8
9 This utility is stateful: it keeps precomputed data hashes in separate
10 statefile and use it to determine if we need to update block of data.
11
12     # sync from very fast SSD to slow USB connected HDD
13     % ./syncer -src /dev/ada0 -dst /dev/da0 -state state.bin
14     [%%%%%%]
15     # all blocks were transferred to da0
16
17 Now we have statefile containing cryptographic hashes of the blocks from
18 source and copy of all read data in destination. Now if we run it again:
19
20     % ./syncer -src /dev/ada0 -dst /dev/da0 -state state.bin
21     [....%.]
22     # only one block was transferred to da0
23
24 Only one modified block was transferred during this session. We read all
25 data from source again, compute hashes and understand what was updated
26 since the last run. Statefile is updated at the end.
27
28 Utility parallelize hash computations among all found CPUs. It updates
29 statefile atomically (saves data in temporary file and then renames it).
30 You can configure the blocksize: shorter transfers but bigger statefile
31 (it is kept in memory), or larger transfer and smaller statefile. All
32 writes are sequential.
33
34 syncer is free software: see the file COPYING for copying conditions.
35
36 INSTALLATION
37
38     % go get github.com/dchest/blake2b
39     % go build
40     # syncer executable file should be in current directory
41
42 STATEFILE FORMAT
43
44     SRC_SIZE || BLK_SIZE || HASH0 || HASH1 || ...
45
46 SRC_SIZE contains size of the source, when it was firstly read. BLK_SIZE
47 is the blocksize used. Both is 64-bit big-endian unsigned integers. If
48 either size or blocksize differs, then syncer will deny using that
49 statefile as a precaution. HASHx is BLAKE2b-512 hash output, 64 bytes.