If I recall incron details correctly, you get multiple entries in your log
because you run your script multiple times at different events:
IN_CLOSE_WRITE,IN_NO_LOOP

Your other question: You see "create" in your log because that is what your
echo command puts there in your script.

-Tomas

On Nov 17, 2017 11:47 AM, "Denis Heidtmann" <denis.heidtm...@gmail.com>
wrote:

I have pursued Tomas' advice to use incron to automatically send files
written by the win2k print driver to the printer.  I have everything down
to one issue.  To test, I have a simple script (intest.sh) that just sends
the event responded to to a log file:

#! /bin/bash
# test of incron
echo "tes1 create " $1 >> /home/denis/incronlog.log

The incron table is:

/home/denis/win2kfiles/Print_files IN_CLOSE_WRITE,IN_NO_LOOP
/home/denis/scripts/intest.sh $#

The resulting log is:

tes1 create  test12
tes1 create  test12.PLT
tes1 create  test12.PLT
tes1 create  test12.PLT

It generates multiple entries for one file added (i.e., one print
command).  I added  IN_ONESHOT to the incrontab:

/home/denis/win2kfiles/Print_files IN_CLOSE_WRITE,IN_ONESHOT,IN_NO_LOOP
/home/denis/scripts/intest.sh $#

I still got multiple entries in the log.


Questions:
Why does the log not say "close" instead of "create"?
Why four entries?
What might the result be when the script intest.sh is replaced by one that
prints and deletes the files?  Will it be called 4 times in rapid
succession?

Any suggestions for testing further?

Thanks,
-Denis
_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to