Git Product home page Git Product logo

birsync's Introduction

birsync

Bash Inotify Rsync = birsync!

birsync uses Linux's inotify facility to detect file and folder changes in a watched directory. When a change is detected, birsync spawns an rsync process to sync those changes to a desired server, respecting your bandwidth, and never running more than one instance of rsync at a time.

birsync should run on most Linux platforms, including embedded devices. As long as you can get inotifywait (part of inotify-tools) on your platform (ie. ipkg, optware), it should work.

Tested on QNAP NAS to sync an FTP root securely to a cloud server, since FTP on the open Internet is bad.

Features

  • watches for changes in files and directories
  • recursively adds directories created in watched directories
  • ensures only one rsync runs at a time
  • bandwidth limiting (an rsync feature)

Goals

  • Embedded device compatibility
  • Bash 3/4 compatible
  • minimal subshells spawned (this is costly)
  • logfile management

Usage

  1. change variables in script according to your needs, particularly watcheddir= and rsyncdest=.

  2. Set up SSH pubkey auth (passwordless) between your client and the destination

  3. run it!

    $ ./birsync

Troubleshooting

  1. check birsync-error.log, birsync-sync.log and birsync-changes.log for clues
  2. make sure lockfile is baleeted if rsync really is not running

birsync's People

Contributors

jaygoldberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

johnsonhit maxpy

birsync's Issues

add retry logic

birsync will stop syncing if any transient issue happens with rsync (exit code != 0).

Our goal should be to add a sleep, that increases with time on every failure, and eventually gives up on a certain number of retries.

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.