summaryrefslogtreecommitdiff
path: root/examples/daemon.py
blob: 1b63999ce531e5ac9399614dde7fab4e1517b181 (plain)
1
2
3
4
5
6
7
8
9
# Example
#
import pyinotify

wm = pyinotify.WatchManager()
notifier = pyinotify.Notifier(wm)
wm.add_watch('/tmp', pyinotify.ALL_EVENTS)
notifier.loop(daemonize=True, pid_file='/tmp/pyinotify.pid', force_kill=True,
              stdout='/tmp/stdout.txt')