0

I have installed Watcher this way: both watcher.py and watcher.ini are located in /etc I also installed pyinotify and it does work when I use python -m pyinotify -v /var/www

However, I want to use the daemon and when I start watcher.py, I get weird lines on my watcher.log (see below). I also included my watcher.ini file.

Note: I have the latest version of Python. The watcher.py can be found here

What is wrong with what I did? Also, do I really need pyinotify? Thanks a lot for your help

watcher.ini:

[DEFAULT]
logfile=/var/log/watcher.log
pidfile=/var/run/watcher.pid

[job1]
watch=/var/www
events=create,delete,modify
recursive=true
command=mkdir /home/mockfolder ## just using this as test

watcher.log:

2012-09-22 04:28:23.822029 Daemon started
2012-09-22 04:28:23.822596 job1: /var/www
Traceback (most recent call last):
  File "/etc/watcher.py", line 359, in <module>
    daemon.start()
  File "/etc/watcher.py", line 124, in start
    self.run()
  File "/etc/watcher.py", line 256, in run
    autoadd   = self.config.getboolean(section,'autoadd')
  File "/usr/lib/python2.7/ConfigParser.py", line 368, in getboolean
    v = self.get(section, option)
  File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'autoadd' in section: 'job1'
quanta
  • 50,327
  • 19
  • 152
  • 213
ericd
  • 213
  • 1
  • 10

1 Answers1

1
ConfigParser.NoOptionError: No option 'autoadd' in section: 'job1'

As far as I know, autoadd option is required. You can set it to false if you don't want to watch the new subdirectory:

; if true, watcher will automatically watch new subdirectory
autoadd=false

/tmp/watcher.log:

2012-09-23 22:30:33.934975 Daemon started
2012-09-23 22:30:33.935313 job1: /tmp

ps -ef | grep [w]atcher

quanta 19813 1 0 22:30 ? 00:00:00 /usr/bin/python2.7 ./watcher.py start --config watcher.ini

quanta
  • 50,327
  • 19
  • 152
  • 213