[PLUG] incron issue

Denis Heidtmann denis.heidtmann at gmail.com
Fri Nov 17 19:46:53 UTC 2017


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



More information about the PLUG mailing list