What is wrong with my Watcher (incron-like) daemon?
Posted
by
eric01
on Server Fault
See other posts from Server Fault
or by eric01
Published on 2012-09-22T18:34:08Z
Indexed on
2012/09/22
21:39 UTC
Read the original article
Hit count: 351
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'
© Server Fault or respective owner