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.
-
Install
ipptool
by runningyum install cups-ipptool
. -
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
-
Then set script as executable (i.e.,
chmod +x /etc/jobs/nozzle-check.sh
) . -
Setup
Cron
job on nethserver the following example is created in the nethservercrontab
module and runs the job once a week on Sunday at 10 am.