Evaggelos Balaskas - System Engineer

The sky above the port was the color of television, tuned to a dead channel

Blog
Posts
Wiki
About
Contact
rss.png twitter linkedin github gitlab profile for ebal on Stack Exchange

PIrsyncD - Python Inotify Rsync Daemon

Published by ebal on Monday, 13 July 2009

This is the home page of pirsyncd.
pirsyncd stands for: Python Inotify Rsync Daemon.

Created by Evaggelos Balaskas <ebalaskas AT ebalaskas DOT gr>

Description:
This is an attempt of writing a daemon to watch a directory for kernel’s inotify events and then execute an rsync command to synchronize two different directories (local or remote). This is a poor man’s mirroring or an alternative (not so) real data replication mechanism and it is based on Pyinotify.

Download:
Always the latest version is here: pirsyncd
Latest version is 20110412

Current md5sum & sha1sum:

md5: e2cc45ae7c5f163cd3f4a1ce39b60c38
sha1: f8fc7ea799976fa699c0a6db7ff014c6fc9afb33

or via mercurial, pirsyncd on bitbucket

hg clone https://ebal@bitbucket.org/ebal/pirsyncd/

Features:
Some of the features of the pirsyncd:

  • There is no need of installation!
  • Run as a Daemon
  • Can run as a Daemon in foreground
  • Simple Configuration, you only have to configure your source and destination directories
  • Configuration Check at the begging
  • Ability to check and stop the daemon
  • Syntax help with ––help
  • For every parameter there is a usage examples with ––examples
  • Support multiple running instances
  • Mirroring to a remote (destination) server (needs password-less connection) through ssh connection
  • Mirroring to a remote (destination) server (needs rsync password-file) through rsync connection
  • Error handling via exceptions
  • A customized delay for mirroring directories (dont rsync asap when an event is trigged)
  • Gets arguments from command line - there is no need of hack the code.
  • Synchronization at start (mirroring via rsync) - first run
  • Definition of rsync version from command line
  • Logging functionality of rsync process
  • Partial rsync functionality
  • Append rsync functionality
  • Functionality to exclude files larger than MAX-SIZE or smaller than MIN-SIZE
  • Debugging pyinotify events
  • Debugging rsync command
  • Autolearning new subdirectories
  • Rsync & Pyinotify exclude pattern
  • Resolving duplicates inode events for multiple files/events
  • You can rsync every n (NUMBER) inode events (simple delay method)
  • Supports python3 with pirsyncd.Py3k
  • Pyinotify version 0.9.1 (20110405)
  • Clean code and python code styling using pylint
  • 7.58/10 (previous run: 7.50/10) with pylint !
  • Lines of code (has a lot of comments !) and it is written on KISS principle
    
          egrep -vc '#|^$|"""' pirsyncd
          427
    

pirsyncd monitors for these inotify events:

  • IN_ATTRIB
  • IN_CLOSE_WRITE
  • IN_CREATE
  • IN_DELETE
  • IN_MODIFY
  • IN_MOVED_TO
  • IN_MOVED_FROM
  • IN_DELETE_SELF

PS: this is my very first python script, i would appreciate any comments

FAQ:
For people who can read greek, there is a FAQ about pirsyncd: FAQ – pirsyncd

Mini Presentation:
Here is a mini presentation or inotify,pyinotify and pirsyncd

You can find pirsyncd on:

  • sourceforge
  • google code
  • freshmeat
  • bitbucket
  • famous why
  • softpedia
  • nikhef

Search

Admin area

  • Login

Categories

  • blog
  • wiki
  • pirsynd
  • midori
  • books
  • archlinux
  • movies
  • xfce
  • code
  • beer
  • planet_ellak
  • planet_Sysadmin
  • microblogging
  • UH572
  • KoboGlo
  • planet_fsfe

Archives

  • 2025
    • April
    • March
    • February
  • 2024
    • November
    • October
    • August
    • April
    • March
  • 2023
    • May
    • April
  • 2022
    • November
    • October
    • August
    • February
  • 2021
    • November
    • July
    • June
    • May
    • April
    • March
    • February
  • 2020
    • December
    • November
    • September
    • August
    • June
    • May
    • April
    • March
    • January
  • 2019
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2018
    • December
    • November
    • October
    • September
    • August
    • June
    • May
    • April
    • March
    • February
    • January
  • 2017
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2016
    • December
    • November
    • October
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2015
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • January
  • 2014
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2013
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2012
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2011
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2010
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2009
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
Ευάγγελος.Μπαλάσκας.gr

License GNU FDL 1.3 - CC BY-SA 3.0