Reputation: 21371
Users sometimes add files to a directory on a linux server. I was looking at ways to be informed when a file has been added to this directory. I found inotify-tools:
https://github.com/rvoicilas/inotify-tools/wiki/
But I am not too sure how to go about using it. I can't seem to find a proper documentation on it.
I would appreciate it if anyone with experience in it could guide me.
Upvotes: 2
Views: 5243
Reputation: 166399
Try using entr
, e.g.
while true; do find path/ | entr -d echo Changed | mail [email protected]; done
or:
while true; do ls path/* | entr -pd echo Changed | mail [email protected]; done
Upvotes: 0
Reputation: 76
With inotifywait you can do what you want, check the manual page.
Upvotes: 2