Oct 21, 2011 #1 Scunningham99 Programmer Joined Sep 20, 2001 Messages 815 Location GB does anyone have an existing script that can be put in the cron whcih checks the print queue ie lpstat -o and checks if it exceeds X amount of jobs Sy UK
does anyone have an existing script that can be put in the cron whcih checks the print queue ie lpstat -o and checks if it exceeds X amount of jobs Sy UK
Oct 21, 2011 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR What have you tried so far and where in your script are you stuck ? Tip: man wc Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
What have you tried so far and where in your script are you stuck ? Tip: man wc Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Oct 21, 2011 Thread starter #3 Scunningham99 Programmer Joined Sep 20, 2001 Messages 815 Location GB N=`lpstat -o |wc -l |awk '{ print $1 }'` echo $N if [ $N -gt 20 ]; then echo "More than 20 Jobs in the Print Queue!!" fi; Sy UK Upvote 0 Downvote
N=`lpstat -o |wc -l |awk '{ print $1 }'` echo $N if [ $N -gt 20 ]; then echo "More than 20 Jobs in the Print Queue!!" fi; Sy UK
Oct 21, 2011 #4 SamBones Programmer Joined Aug 8, 2002 Messages 3,186 Location US Try this... Code: #!/bin/ksh if (( $(lpstat -o |wc -l) > 20 )) then print "More than 20 Jobs in the Print Queue!!" fi Upvote 0 Downvote
Try this... Code: #!/bin/ksh if (( $(lpstat -o |wc -l) > 20 )) then print "More than 20 Jobs in the Print Queue!!" fi