incrontab entries do not trigger for IN_CREATE or IN_CLOSE_WRITE

Discussion in 'HOWTO-Related Questions' started by yamex5, Sep 27, 2011.

  1. yamex5

    yamex5 New Member

    Hello all,

    I need to trigger a job on a hudson server, and a new file or email will do just fine.
    I just found out about inotify and incron, and found Falko Timme's tutorial in these forums http://www.howtoforge.com/triggering-commands-on-file-or-directory-changes-with-incron very clear. I am on Ubuntu 11.04 and have installed both inotify-tools and incron. I have also added root to the /etc/incron.allow file.
    Inotify commands are working from the command line, and I am able to insert, list and remove incron commands using incrontab with the corresponding -e, -l and -r options successfully.
    The issue is that I have added the following using 'sudo incrontab -e':
    Code:
    /home/systest  IN_CREATE  echo "This is an incron test" > /home/systest/cron_test.txt
    
    I save the contents and incrontab reports back that the table is updated.
    I cd to the /home/systest directory and using gvim create a new file named 'junk' and save it.
    If I perform an 'ls' at this point, I expect to see the new file 'cron_test.txt' but it isn't there. Is there any other configuration to procedures I need to perform to get incron to work?

    Thank you in advance,

    Mike
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Try IN_MODIFY instead of IN_CREATE (because the /home/systest directory exists already).
     
  3. yamex5

    yamex5 New Member

    Dear Falko,

    Thank you for the tutorial and the IN_MODIFY suggestion.
    However, changing the mask to IN_MODIFY still did not trigger the script to write to the /home/systest directory.
    I did find that I was supposed to setup an incron.conf file that points to itself and the incron.allow files, and I also learned that I needed to start the incrond daemon. Even with all of that, incron is not triggering.
    Is there anything else that I need to do?

    Much thanks,

    -Mike L.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Did you check your logs for errors?
     

Share This Page