3 Fast stateful file/disk data syncer.
7 The main purpose of this utility is fast data synchronization between
8 two hard drives: one is fast (SSD, SATA HDD), another is connected
9 through slow USB interface. Target is to lower data amounts needed to
12 This utility is stateful: it keeps precomputed data hashes in separate
13 statefile and uses it to determine if we need to update block of data.
15 # sync from very fast SSD to slow USB connected HDD
16 % ./syncer -src /dev/ada0 -dst /dev/da0 -state state.bin
18 # all blocks were transferred to da0
20 Now we have statefile containing cryptographic hashes of the blocks from
21 source and copy of all read data in destination. Now if we run it again:
23 % ./syncer -src /dev/ada0 -dst /dev/da0 -state state.bin
25 # only one block was transferred to da0
27 Only one modified block was transferred during this session. We read all
28 data from source again, compute hashes and understand what was updated
29 since the last run. Statefile is updated at the end.
31 Utility parallelize hash computations among all found CPUs. It updates
32 statefile atomically (saves data in temporary file and then renames it).
33 You can configure the blocksize: shorter transfers but bigger statefile
34 (it is kept in memory), or larger transfer and smaller statefile. All
35 writes are sequential.
37 syncer is free software: see the file COPYING for copying conditions.
41 % go get github.com/dchest/blake2b
43 # syncer executable file should be in current directory
47 SRC_SIZE || BLK_SIZE || HASH0 || HASH1 || ...
49 `SRC_SIZE` contains size of the source, when it was initially read.
50 `BLK_SIZE` is the blocksize used. Both are 64-bit big-endian unsigned
51 integers. If either size or blocksize differs, then syncer will deny
52 using that statefile as a precaution. `HASHx` is BLAKE2b-512 hash