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