forked from manos/python-inotify-tail_example
orenhe/python-inotify-tail_example
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This script emulates tail -F (follows log files that have been moved, then created again, a la logrotate), as an example of how to use pyinotify. Note the strangeness in that you can't watch an individual file with IN_MOVED_SELF -- pyinotify will error with "file moved and we can't track it, and therefore can't trust it.. track the directory instead." Therefore, we track the directory and parse the IN_MODIFY path to verify the event relates to our specific file. USAGE: (pip install pyinotify) ./tail-F_inotify.py /path/to/file [--debug]
About
Example of using pyinotify to emulate GNU tail -F (follows rotated log file)
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 100.0%