sync-mht

Fast incremental file transfer using Merkle-Hash-Trees

https://github.com/ekarayel/sync-mht

Version on this page:0.3.8.0
LTS Haskell 6.35:0.3.8.5
Stackage Nightly 2016-05-25:0.3.8.4
Latest on Hackage:0.3.8.5

See all snapshots sync-mht appears in

MIT licensed and maintained by Emin Karayel
This version can be pinned in stack with:sync-mht-0.3.8.0@sha256:b517c40c092febd9e7ff4d113450068cedd6dfcd4d3e8ab5bbd6e5bdc6840760,5562

sync-mht

Build Status codecov.io Hackage

Synopsis

Fast incremental file transfer using Merkle-Hash-Trees

Description

A command line tool that can be used to incrementally synchronize a directory hierarchy with a second one. It is using a Merkle-Hash-Tree to compare the folders, such that the synchronization time and communication (round) complexity grows only logarithmically with the size of the directories (assuming the actual difference of the directories is small).

The communication happens through standard streams between parent and child processes, which can easily be routed through remote command execution tools.

Examples

The following command

sync-mht -s foo/ -d bar

will synchronize the local folder bar/ with the local folder foo/, but

sync-mht -s foo/ -d remote:/bar -r "ssh [email protected] sync-mht"

will synchronize the folder bar/ in the home directory of the user fred on the host machine example.org with the local folder foo/.

It is also possible to use it with docker, e.g.

sync-mht -s foo/ -d remote:/bar -r "docker run -i --volumes-from bar ekarayel/sync-mht sync-mht"

to synchronize the folder /bar (of the container named bar) with the local folder foo/.

Note that: The options -a -u –delete respectively, allow copying of files to the target directory, updating files that are already in the target directory - not matching the contents in the source directory and deleting files that are in the destination directory but not in the source directory.

Setup

Installing sync-mht can be done using stack with the following steps:

git clone --recursive https://github.com/ekarayel/sync-mht.git
cd sync-mht
stack exec runhaskell configure.hs
stack install