0

I need to get alerted when a new directory or sub directory is created within the root directory that I am monitoring. The alert has to be triggered to a PHP file. How do I do this on CentOS? Is inotify the best route to take? I just need to know when a new directory is created and the location. So I am looking for the simplest of ideas to do this.

  • I have full control of the server
  • I just need to monitor creation of a directory
  • Alerts have to be sent to a PHP file (directly or indirectly)

Please send through any ideas you might have.

2 Answers 2

2

If you add the EPEL repo to your CentOS host there is an "incron" package available which works with inotify to do what you're looking to do. Here's the docs: http://inotify.aiken.cz/?section=incron&page=doc&lang=en

1
  • 1
    incron won't work recursively though. inotifywatch from inotify-tools will. Jul 27, 2010 at 22:51
0

CentOS 6.3 has inotifywait built in.

1
  • You might consider adding more detail to your answer. How long has it been in CentOS?
    – Jacob
    Mar 18, 2013 at 22:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .