pushme: Tool to synchronize multiple directories with rsync, zfs or git-annex

[ bsd3, program, system ] [ Propose Tags ]

Script I use for synchronizing my data among machines.

[Skip to Readme]
Versions [faq] 0.2.0, 1.0.0, 1.0.1, 1.1.0, 1.4.0, 1.5.0, 2.0.1, 2.0.2, 2.1.1, 2.1.3
Dependencies aeson (>=0.6.0), base (==4.*), bytestring (>=0.9.2), containers (>=0.4.2), deepseq (>=1.3), hslogger (>=1.2), io-storage (>=0.3), lens (>=2.8), old-locale (>=1.0.0), optparse-applicative (>=, parallel-io (>=0.3.2), pointless-fun (>=1.1), regex-posix (>=0.95), shelly (>=, system-fileio (>=0.3.9), system-filepath (>=0.4.7), text (>=0.11.2), text-format (>=0.3), time (>=1.4), unix (>=2.5.1), unordered-containers (>=0.2.2), yaml (>=0.8) [details]
License BSD-3-Clause
Author John Wiegley
Maintainer John Wiegley <johnw@newartisans.com>
Category Development
Home page https://github.com/jwiegley/pushme
Source repo head: git clone https://github.com/jwiegley/pushme
Uploaded by JohnWiegley at 2013-12-02T09:33:08Z
Distributions NixOS:2.1.3
Executables pushme
Downloads 5982 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Successful builds reported [all 8 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for pushme-1.5.0

[back to package description]

This is the script I use for synchronizing data between my machines (and also to directories on the same machine, externally connected drives, and to and between ZFS filesystems).

Here is an example set of files for synchronizing my home directory and /usr/local via rsync between two machines: foo and bar. First, ~/.pushme/stores.yml:

- Targets:
  - - bar
    - - home
      - local
  HostRe: [Ff]oo
  Name: Foo
  UserName: johnw
  SelfRe: [Ff]oo
  ZfsPool: null
  ZfsPath: null
  IsPrimary: true
  AnnexName: foo
  AnnexFlags: []
- Targets:
  - - foo
    - - home
      - local
  HostRe: [Bb]ar
  Name: Bar
  UserName: johnw
  SelfRe: [Bb]ar
  ZfsPool: null
  ZfsPath: null
  IsPrimary: false
  AnnexName: bar
  - - 'foo'
    - - - 'home'
        - - '-\('
          - '--not'
          - '--in'
          - 'foo'
          - '--and'
          - '--not'
          - '--in'
          - 'web'
          - '-\)'

Then, ~/.pushme/filesets.yml:

- Priority: 60
  Name: home
  Class: quick,main
  ReportMissing: true
- Priority: 80
  Name: local
  Class: system,main
  ReportMissing: false

And finally, ~/.pushme/containers.yml:

- Store: foo,bar
  Recurse: false
  Fileset: home
  PoolPath: null
  IsAnnex: false
  LastRev: null
  LastSync: null
  Path: ~/
- Store: foo,bar
  Recurse: false
  Fileset: local
  PoolPath: null
  IsAnnex: false
  LastRev: null
  LastSync: null
  Path: /usr/local/

Now I can run the following command:

foo $ pushme bar
15:18:44 - [NOTICE] Synchronizing Foo -> Bar
15:18:44 - [NOTICE] Sending Foo/home → Bar
15:18:52 - [NOTICE] Sent 151.0M in 131 files (out of 1.37G in 12,418)
15:20:26 - [NOTICE] Sending Foo/local → Bar
15:21:02 - [NOTICE] Sent 0b in 0 files (out of 6.45G in 207,453)

If you are wondering about the complexity of keeping filesets separate from containers, it's because I use pushme for several different scenarios: rsync'ing between machines, rsync'ing into ZFS filesystems, and sending ZFS filesystems as snapshot stream between servers. Pushme is able to handle all of these scenarios, but doing so required a bit more abstraction than a simple rsync-only tool would have needed.

Some common options include:

$ pushme -c quick bar       # only sync filesets with the "quick" class
$ pushme -f home bar        # only sync the "home" fileset
$ pushme -n bar             # don't do anything, just scan
$ pushme -N bar             # don't even scan
$ pushme -v bar             # show commands being executed
$ pushme -D bar             # show more info than you want to see