I need to watch a file system for the creation of new files of a specific type. Thinking that this would be a perfect use case for inotifywatch
, I set out to try and make something work. I went to the man pages for the program, tried to implement things, got errors.. then tried to run their basic example.
inotifywatch -v -e access -e modify -t 60 -r ~/
I got the same eorror which was
Establishing watches...
OK, /home/mcamp is now being watched.
Total of 27243 watches.
Finished establishing watches, now collecting statistics.
Will listen for events for 30 seconds.
total access modify filename
Segmentation fault (core dumped)
What's causing this? inotifywait
works for a single file.. I haven't had any luck with google. Has anyone else seen this error before and know how to handle it?
TIA
-m
option (and a loop, in shell or any other language). eg: https://unix.stackexchange.com/questions/24952/script-to-monitor-folder-for-new-files . caveat: special characters in filenames might not be easy to handle – A.B Sep 15 '21 at 20:42