2

I have this incrontab, which is monitoring the master Directory to check if the event occurs where a new file is placed here ... and run the php file.

/var/www/html/docs/int/master IN_MOVE php /var/www/html/shscript/work.php

I have a crontab that runs every one minute, and invokes the execution of a .sh file, the content of this SH is to copy the txt files to the Master directory that is in the previous incrontab (that work well):

cd /mnt/test1/int/master
cp *.txt /var/www/html/docs/int/master

The probllem:

when the cron is end of run (copy is successfull), but the icron is not triggering, no detecting event like: IN_MOVE, IN_MOVED_TO; but if i change the event to: IN_MODIFY ; Work well and execute the php file; but i not need to run the php file on modify event i need run it if the file is succefull copy. I do not know what I'm doing wrong.

1 Answers1

2

the result script to do:

/var/www/html/docs/int/master IN_CLOSE_WRITE php /var/www/html/shscript/work.php

Script file to copy from the master repository to the Work directory and after that to move it to processed

#!/bin/sh
cd /mnt/test1/int/master
find . -maxdepth 1 -type f -exec bash -c '
for item do
    cp $item /var/www/html/docs/int/master && mv -f $item /mnt/test1/int/master/procesado
done
' bash {} +