Shell script to find the print queue on Linux Server

In this post I am going to share a shell script to find if the print queue on a server of all printers is more than 50. You can customize based on your requirement.

Sample Code:

cat /root/bin/

lpstat `lpstat -a | awk '{print $1}'` > printq.lst
qcount=`wc printq.lst | awk '{print $1}'`
if [ $qcount -gt 50 ]
  mail -s "Print Queue is more than 50 in funebs122" < printq.lst

If you like please follow and comment