#!/sbin/runscript ############################################################################## depend() { need net after bootmisc } checkconfig() { if [ ! -f /etc/conf.d/lsyncd ] ; then eerror "file /etc/conf.d/lsyncd missing" eerror "see sample /usr/share/lsyncd/lsyncd.conf" return 1 fi return 0 } start() { checkconfig || return $? ebegin "Starting lsyncd" start-stop-daemon --start --name lsyncd \ --user ${LSYNCD_USER} --nice 10 \ --exec /usr/bin/lsyncd \ -- ${LSYNCD_OPTS} eend $? } stop() { ebegin "Stopping lsyncd" killall -q rsync ; start-stop-daemon --stop lsyncd eend $? } ############################################################################## # /etc/conf.d/lsyncd ############################################################################## LSYNCD_USER="myusr:mygrp" LSYNCD_OPTS="/path/to/source/.lsyncd" ############################################################################## # /path/to/source/.lsyncd ############################################################################## sync{ default.rsyncssh, source = "/path/to/source/", host = "user@server", targetdir = "/path/to/target/", rsyncOps = {"--bwlimit=128"} }