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.
результат выполнения сценария:
/var/www/html/docs/int/master IN_CLOSE_WRITE php /var/www/html/shscript/work.php
Файл сценария для копирования из главного репозитория в рабочий каталог, а затем для его перемещения в обрабатываемый
#!/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 {} +