If your
find is capable enough, it will be able to give you minute granularity. If not, maybe we can develop something here.
If all the entries in /var/spool/lp/requests are the names of printers you want to connect to, and there are none there which you don't want to connect to, just loop over those then?
The wc -l is Useless
Code:
for PRINTER in /var/spool/lp/request/*
do
if find "$PRINTER" -mmin +60 | grep "$LOCAL_SERVER" >/dev/null
then
echo `basename "$PRINTER"` >> /cia/ciaadm/bin/printer.list
/usr/local/bin/canprint `basename "$PRINTER"`
let cnt=cnt+1
fi
done
I guess the cnt is used outside of your script somewhere ...?