Skip to content

Commit

Permalink
add logfile support
Browse files Browse the repository at this point in the history
  • Loading branch information
hollow committed Oct 6, 2009
1 parent 4adf745 commit 93377cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inosync.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def sync(self):
return
args = [config.rsync, "-ltrp", "--delete"]
args.append("--bwlimit=%s" % config.rspeed)
if config.logfile:
args.append("--log-file=%s" % config.logfile)
if "excludes" in dir(config):
for exclude in config.excludes:
args.append("--exclude=%s" % exclude)
Expand Down Expand Up @@ -160,6 +162,9 @@ def load_config(filename):
if config.edelay < 1:
raise RuntimeError, "event delay needs to be greater than 1"

if not "logfile" in dir(config):
config.logfile = None

if not "rsync" in dir(config):
config.rsync = "/usr/bin/rsync"
if not os.path.isabs(config.rsync):
Expand Down
3 changes: 3 additions & 0 deletions sample_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
# realtime side of things)
#edelay = 10

# rsync log file for updates
#logfile = /var/log/inosync.log

# rsync binary path
#rsync = "/usr/bin/rsync"

0 comments on commit 93377cb

Please sign in to comment.