How do I keep two directories using lsyncd?



  • Link: https://github.com/axkibe/lsyncd
    man lsyncd: http://lightnetics.nodebb.com/post/895

    There's already rsync which does syncing between two directories, which can be run via crontab. Which runs periodically to keep files in sync. There's tool called lsyncd that runs as a daemon, and monitors directories for any changes, if it find changes at the source, it syncs immediately.

    The configuration file is /etc/lsyncd.conf, the format of the file is based on the LUA language format. https://en.wikipedia.org/wiki/Lua_(programming_language)

    Have a look in the following directory for examples

    $ pwd
    /usr/share/doc/lsyncd-2.1.5/examples
    

    In a simple config:

    settings = {
    	statusFile = "/tmp/lsyncd.stat",
    	statusInterval = 1,
    }
    
    sync{
    	default.rsync,
    	source="src",
    	target="trg",
    }
    

Log in to reply
 

© Lightnetics 2024