0

I need your help - using Inotify I am watching a directory for the changes like create, delete, rename and move. I want these event to be logged in a file and I want to run Inotify as a service.

1 Answers1

2

You need to install incron package. Then, adding new events to be monitored can be done using

incrontab -e

You can add a line to monitor specific directory. The general format is like:

<path> <mask> <command>

Directory path should be specified first, followed by event mask, and finally the command/script you want to execute. You can read man 5 incrontab for available masks and more info.

In your case, you can create a script to log the relevant events.

Khaled
  • 35,688
  • 8
  • 69
  • 98