How-To automatically run a print nozzle check for ip printers via crontab and ipptool (confirmed working on Epson Eco-Tank ET-2810)

Basically I have an EPSON Eco-tank Printer (ET-2810) and set this up to avoid print head clogs if the printer is not in use daily.

  1. Install ipptool by running yum install cups-ipptool .

  2. Create the following script changing the IP address to match your printer and save to your preferred Cron directory (i.e, /etc/jobs/) .

nozzle-check.sh
#!/bin/bash

PRINTERIP=xx.xx.xx.xx

#--- extract embedded spool files
#
#       $IPPTEMP        /usr/share/cups/ipptool/print-job.test comes with Mint 19.x but not with CentOS7

IPPTEMP="/tmp/cups-ipptool-print-job.test"

cat << EOF | base64 -di | gunzip > "$IPPTEMP"
H4sIAFDVhWQAA21Ry07DMBA8x1+xanvElbhxQxEKqEAfalPB1U02qaGxg70WIMS/s04fKVIv0WZ2
dndmPISF04ZAAaEnaFWNELw2NbQRl292I35EMoR8i2BUg2ArIK4jfTwei2SWTjMY7LdUencc7wD5
aDcDcRy3LTpF2hogyywUyXyRLdN8Mp/19I6dEjm9CXzjCjwpR3GjNt3hfkvtbGg7DQ/L+XrRd6Q6
zUtStUjSPF9CsVXOI1vtm0coUCVvDrSdMnWIMZzxjKLg1E6eemgO7OD0Pil0MtYj/hxaXVoOPwIn
xfolO3ayA0exPLAa3eAUS63y7xahtEVokJOorGsUwSgmStwRR5P8IJftRQ01Oihsq9HDNU/cT56z
/Yp4tkv2ZctbOVJiCR6UQ5g/3Ypklaf5egU+FAV6X4WdtO+XUalrYx2W0jrpw4atEQspzzT1d3qM
jcEnx/bVYkF8L3tdZHd5Z0aX/35jfr/iDwfmEbqXAgAA
EOF

#--- print

if [ -e "$IPPTEMP" -a -e "$SPLTEMP" ] ; then
  ipptool -v -t -I \
    -d filetype=application/octet-stream \
    -f "$(readlink -f "$SPLTEMP")" \
    ipp://$PRINTERIP:631/ipp/print \
    "$IPPTEMP"
  RC=$?
  [ "$RC" == "0" ] || echo >&2 "ERROR: ipptool rc=$RC"
else
  echo >&2 "ERROR: can't create temporary files"
  RC=1
fi

#--- cleanup

rm "$IPPTEMP" "$SPLTEMP"
exit $RC
  1. Then set script as executable (i.e., chmod +x /etc/jobs/nozzle-check.sh) .

  2. Setup Cron job on nethserver the following example is created in the nethserver crontab module and runs the job once a week on Sunday at 10 am.
    Screenshot from 2024-05-02 11-24-28

4 Likes

Thanks for sharing. Might be a nice addition for future printer server for NS8

1 Like

I agree, the crontab manager is/was loved by many for many different reasons, Sot it’s availability for NS8 would be great!

1 Like