watching directories recursively

From: Digna González <digna.gonzalez_at_gmail.com>
Date: Thu, 25 Sep 2008 20:16:47 +0200

Hello,

    I am working in a proyect in which I need to watch directories
recursively. As I know that isn't still supported, I tried to do a little
hack (but it doesn't work):

*I have added to my incron table a line that runs the script dirmon.sh
everytime a directory is created inside the directory I want to monitor:

/dir_to_watch IN_CREATE script_to_exec.sh
/dir_to_watch IN_ONLYDIR IN_CREATE dirmon.sh $@/$#

That script, dirmon.sh, is intended to add to my incron table the lines to
start watching that new subdirectory:

#!/bin/bash
echo $1 IN_CREATE sanity.sh>>/var/spool/incron/root
echo $1 'IN_ONLYDIR IN_CREATE dirmon.sh $@/$#'>>/var/spool/incron/root

The problem is it doesn't write anything to my incron table. If I try to
write it to another file, it does work, but not with the "root" file. Maybe
because it is in use?

Is there any way I could make this work?

Thanks,

Digna
Received on Thu Sep 25 2008 - 20:17:32 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST