Hi All,
I am thinking about an idea, but it requires that I be able to watch several directories for files that are added, deleted or maybe changed.
Let start with adding files. What tools are available for me to watch a directory. In an example, if a file is added to a directory I want to run a shell script that will do some conversation on the file to produce a second copy.
I have the shell scripting down, I am not sure how to watch, realize change and kick off the script with the parameters of the directory and what was added.
Would anyone have thoughts?
-Jason
On Wed, Mar 16, 2011 at 5:12 PM, R P Herrold herrold@owlriver.com wrote:
On Wed, 16 Mar 2011, Jason Slack-Moehrle wrote:
Would anyone have thoughts?
don't reinvent the wheel
inotify builds and works fine on CentOS 5
-- Russ herrold
In particular, 'incron' is very cool. I have just started using it for a project and it does exactly what you need. There are packages already available in the EPEL repository, no need to build.
On Wed, 16 Mar 2011, R P Herrold wrote:
On Wed, 16 Mar 2011, Jason Slack-Moehrle wrote:
Would anyone have thoughts?
don't reinvent the wheel
inotify builds and works fine on CentOS 5
And it should be available by default in CentOS 6.
-Connie Sieh
-- Russ herrold _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Wed, 16 Mar 2011, R P Herrold wrote:
On Wed, 16 Mar 2011, Jason Slack-Moehrle wrote:
Would anyone have thoughts?
don't reinvent the wheel
inotify builds and works fine on CentOS 5
And it should be available by default in CentOS 6.
-Connie Sieh
(sorry, I don't have the original email)...
On that note, I use incron :
http://inotify.aiken.cz/?section=incron&page=about&lang=en
wich also builds fine on centos (5.x)
When you say that inotify is availaible by default on rhel6, in what package ?
Regards,
on 14:06 Wed 16 Mar, Jason Slack-Moehrle (slackmoehrle.lists@gmail.com) wrote:
Hi All,
I am thinking about an idea, but it requires that I be able to watch several directories for files that are added, deleted or maybe changed.
Let start with adding files. What tools are available for me to watch a directory. In an example, if a file is added to a directory I want to run a shell script that will do some conversation on the file to produce a second copy.
I have the shell scripting down, I am not sure how to watch, realize change and kick off the script with the parameters of the directory and what was added.
Would anyone have thoughts?
make
Let start with adding files. What tools are available for me to watch a directory. In an example, if a file is added to a directory I want to run a shell script that will do some conversation on the file to produce a second copy.
I just was working on something like this today - yum search inotify - here's a nice intro with an example close to what I'm using:
https://github.com/rvoicilas/inotify-tools/wiki/#info (inotifywait example 1)
I used -e create -e modify -e delete instead of -e close_wait - see the man page for events.
Very slick so far.
Josh