I have a inotifywait
on syslog
. It works without issue until the log rolls over.
Although the same filename is used, the new file is a new file and inotify
loses its reference.
How do we compensate for this to maintain the watch through the log rollover?
function setup
to init the watch and monitor the file events I'm interested in. On theMOVE_SELF
event I make a recursive call to thesetup
function. That might be a spectacularly bad solution but I'm just a hobbyist so no real damage. A regular restart of the service should ward off disaster but I'm interested in what will happen. How does bash handle recursion?iwatch
as part of the log rollover.man logrotate logrotate.conf
.postrotate
property. Thanks.