sobota, 26 lipca 2014

dir/files change monitoring

1. sudo pip install pyinotify
2. [root@localhost marek]# python -m pyinotify -v /var/log/httpd/

[root@localhost marek]# python -m pyinotify -v /var/log/httpd/
[2014-07-26 19:53:31,874 pyinotify DEBUG] Start monitoring ['/var/log/httpd/'], (press c^c to halt pyinotify)
[2014-07-26 19:53:31,875 pyinotify DEBUG] New <Watch wd=1 path=/var/log/httpd mask=4095 proc_fun=None auto_add=None exclude_filter=<function <lambda> at 0x7fac8bb971b8> dir=True >
[2014-07-26 19:53:57,269 pyinotify DEBUG] Event queue size: 32
[2014-07-26 19:53:57,270 pyinotify DEBUG] <_RawEvent cookie=0 mask=0x2 name=error_log wd=1 >
<Event dir=False mask=0x2 maskname=IN_MODIFY name=error_log path=/var/log/httpd pathname=/var/log/httpd/error_log wd=1 >
[2014-07-26 19:53:57,270 pyinotify DEBUG] Event queue size: 32
[2014-07-26 19:53:57,270 pyinotify DEBUG] <_RawEvent cookie=0 mask=0x2 name=access_log wd=1 >

<Event dir=False mask=0x2 maskname=IN_MODIFY name=access_log path=/var/log/httpd pathname=/var/log/httpd/access_log wd=1 >