Question

Daemon what detects file changing

  • Posted September 9, 2014

I’m looking for some daemon what looks at some folder and makes notification if files was changed there

Subscribe
Share

Assuming that you have a Linux distro, you want to be looking @ the inotify CLI tools (inotifywait and inotifywatch) and create sh scripts around them. There is also a PHP interface for inotify as well if you want to go in that direction.

Man pages:

http://linux.die.net/man/1/inotifywait http://linux.die.net/man/1/inotifywatch


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi Dmgorp,

In Linux systems, you can use incron, which is a crontab scheduler acting on files and directories modifications . This tool can be used just as a cron job (editing with incrontab -e), and manages the following events :

IN_ACCESS File was accessed (read) (*)
IN_ATTRIB Metadata changed (permissions, timestamps, extended attributes, etc.) (*)
IN_CLOSE_WRITE File opened for writing was closed (*)
IN_CLOSE_NOWRITE File not opened for writing was closed (*)
IN_CREATE File/directory created in watched directory (*)
IN_DELETE File/directory deleted from watched directory (*)
IN_DELETE_SELF Watched file/directory was itself deleted
IN_MODIFY File was modified (*)
IN_MOVE_SELF Watched file/directory was itself moved
IN_MOVED_FROM File moved out of watched directory (*)
IN_MOVED_TO File moved into watched directory (*)
IN_OPEN File was opened (*)

Hope this could help,

Regards,

– rustx

it’s that I looked for. Thanks