From f28baa0a46acd6565bd08166cadd01e32cb74455 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Mon, 25 Nov 2013 12:34:42 +0100 Subject: [PATCH 1/2] Update osync.sh --- osync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osync.sh b/osync.sh index dddfa1e..6fd8cc3 100755 --- a/osync.sh +++ b/osync.sh @@ -1703,7 +1703,7 @@ function SyncOnChanges { if ! type -p inotifywait > /dev/null 2>&1 then - LogError "No inotifywait command found." + LogError "No inotifywait command found. Cannot monitor changes." exit 1 fi @@ -1811,7 +1811,7 @@ then then if [ $daemonize -eq 1 ] then - echo $SCRIPT_PID > $PID_FILE + ## echo $SCRIPT_PID > $PID_FILE silent=1 exec > /dev/null 2>&1 fi From 5609c14fcb2cffdda679e45f2919cf90f226a4ab Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Mon, 25 Nov 2013 13:24:55 +0100 Subject: [PATCH 2/2] Added inotifywait dependancy --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42362a1..3a30a5f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Bitpocked inspired me to write my own implementation of a two way sync script, i - Soft deletition and multiple backups handling - Before / after command execution - Time control -- Sync on changes +- Sync on changes, as a deamon Osync uses a master / slave sync schema. It can sync local and local or local and remote directories. By definition, master replica should always be a local directory on the system osync runs on. Also, osync uses pidlocks to prevent multiple concurrent sync processes on/to the same master / slave replica. Be sure a sync process is finished before launching next one. @@ -75,6 +75,8 @@ Once you're confident about your fist runs, you may add osync as cron task with: Additionnaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on master replica. File monitor mode can also be launched in daemon mode. +Note that monitoring changes requires inotifywait command (inotify-tools package for most Linux distributions). +BSD, MacOS X and Windows are not yet supported for this operation mode. $ ./osync.sh /path/to/your.conf --on-changes $ ./osync.sh /path/to/your.conf --on-changes --daemon