GithubHelp home page GithubHelp logo

unisync's Introduction

Unisync

A hackable inotify daemon for Unison..

Features

Unisync.py uses inotify to detect changes in the local unison root and employs the venerable file synchronizer unison to do the real sync.

On start, it runs a full-sync. After that, only localy changed files are syncronized, unless a full-sync is triggered with sigalarm.

Setup

sudo apt install python3 unison python3-pyinotify

#optionally for onscreen notifications:
sudo apt install xosd-bin
  • copy or link unisync.py to a directory included in $PATH, e.g. $HOME/bin/

  • It is possible to create a local root with links to the directories and files that should be syncronized

  • Setup unison profile in $HOME/.unison/<profile>.prf

Usage

unison profile # initial sync

unisync.py profile # run as daemon

Limitations

  • Unisync.py doesn't detect live changes at the remote root. However unison is able to synchronize bidirectional if a full-sync is triggered.

    • A full-sync can be triggered by sending an alarm signal to the unisync.py process: pkill -ALRM unisync.py (that can easily be used from a keyboard shortcut)
  • Only links directly below the root directory are watched by unisync.py

  • Unison must be configured with the follow property to follow specific links to sync their targets (e.g.: follow = Name link_* to follow all links with the prefix link_)

Troubleshooting

  • Make sure to use the same unison version on all devices, otherwise unisons binary exchange format may be incompatible.
  • For Ubuntu you can also download and use a specific deb-package from debian if compatibility with other debian based distributions is required (like Raspbian).

TODO

  • Sync on server-update: Broker service: publish last modifcation of state-file

    • .unison/arXYZ -> roots in line 2
    • filename calculation:
      • 'unison -ignore 'Regex .*' -showarchive'
      • [update.ml:232]
  • (GUI with status icon)

unisync's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.