Mirror job management tool.
Go to file
z4yx 36010dc33e Merge branch 'master' of github.com:tuna/tunasync 2019-11-30 00:08:59 +08:00
autocomplete feat(bash and zsh autocompletion for tunasynctl): 2016-08-02 23:31:54 +08:00
cmd singleton of worker is not used, so remove it 2019-04-11 10:07:42 +08:00
docs/zh_CN add doc for setup btrfs snapshots 2019-08-02 13:31:33 +08:00
internal extract mirror size from rsync provider automatically 2019-04-13 01:27:35 +08:00
manager Fix test: initialize dockerHook with embedded provider 2019-07-31 17:29:28 +08:00
systemd feature(worker): limit rsync memory using cgroup 2016-05-08 17:24:41 +08:00
tests feature(worker): implemented multi-file configrations. closing #23 2016-05-03 16:52:38 +08:00
worker Merge branch 'master' of github.com:tuna/tunasync 2019-11-30 00:08:59 +08:00
.gitignore chore(cmd): added git hash and build date to version 2016-06-15 14:58:27 +08:00
.testandcover.bash ci(tunasync): upload to github releases 2016-11-20 00:51:20 +08:00
.testpackages.txt feature(worker): framework of mirror provider 2016-04-30 16:38:17 +08:00
.travis.yml set golang version to 1.11 2019-07-05 16:54:29 +08:00
LICENSE Initial commit 2014-10-17 16:24:26 +08:00
Makefile ci(tunasync): upload to github releases 2016-11-20 00:51:20 +08:00
README.md Update "Job Run Process" diagram according to runJobWrapper 2019-07-31 12:26:09 +08:00
package.json chore(git): Made this repo commitizen frendly 2016-05-05 11:45:51 +08:00

tunasync

Build Status Coverage Status Commitizen friendly GPLv3

Get Started

Download

Pre-built binary for Linux x86_64 is available at Github releases.

Design

# Architecture

- Manager: Central instance for status and job management
- Worker: Runs mirror jobs

+------------+ +---+                  +---+
| Client API | |   |    Job Status    |   |    +----------+     +----------+ 
+------------+ |   +----------------->|   |--->|  mirror  +---->|  mirror  | 
+------------+ |   |                  | w |    |  config  |     | provider | 
| Worker API | | H |                  | o |    +----------+     +----+-----+ 
+------------+ | T |   Job Control    | r |                          |       
+------------+ | T +----------------->| k |       +------------+     |       
| Job/Status | | P |   Start/Stop/... | e |       | mirror job |<----+       
| Management | | S |                  | r |       +------^-----+             
+------------+ |   |   Update Status  |   |    +---------+---------+         
+------------+ |   <------------------+   |    |     Scheduler     |
|   BoltDB   | |   |                  |   |    +-------------------+
+------------+ +---+                  +---+


# Job Run Process


PreSyncing                           Syncing                               Success
+-----------+     +----------+    +-----------+    +-------------+     +--------------+
|  pre-job  +--+->| pre-exec +--->|  job run  +--->|  post-exec  +-+-->| post-success |
+-----------+  ^  +----------+    +-----------+    +-------------+ |   +--------------+
               |                                                   |
               |                +-----------------+                | Failed
               +----------------+    post-fail    |<---------------+
                                +-----------------+

Building

Setup GOPATH like this.

Then:

go get -d github.com/tuna/tunasync/cmd/tunasync
cd $GOPATH/src/github.com/tuna/tunasync
make

If you have multiple GOPATHs, replace the $GOPATH with your first one.