Need Linux command to reset / restart printer
by knowyrtech from LinuxQuestions.org on (#5HD0Y)
I have a shell script code that prints any new PDF generated to a Brother printer which is connected to a MACOS using the below command
Code:lp -d Brother_HL_L2350DW_series /var/pdfs/11.pdfAfter 2 or 3 days the printer stops to print and I see the printer queue growing with the error message The printer is not responding. See below snapshot:
https://ibb.co/XYF9VFh
Code:tail /var/log/cups/error_log
E [26/Apr/2021:13:38:45 +0200] [Job 15850] The printer is not responding.
E [26/Apr/2021:13:39:45 +0200] [Job 15850] The printer is not responding.
Rustems-iMac:~ rustemince$ lpstat -a
Brother_HL_L2350DW_series accepting requests since Mo 26 Apr 13:24:09 2021
Brother_HL_L2350DW_series_2 accepting requests since Fr 9 Apr 15:28:24 2021
Canon_TS700_series accepting requests since Mo 26 Apr 15:00:32 2021
HP_LaserJet_M203_M206 accepting requests since Sa 3 Apr 09:24:54 2021
HP_LaserJet_M203dw__5F40D6_ accepting requests since Mo 29 Mar 12:26:13 2021
Kyocera_ECOSYS_M5526cdw accepting requests since Di 6 Apr 18:27:08 2021
Kyocera_ECOSYS_M5526cdw_b_3_Fax accepting requests since Di 7 Jan 21:51:33 2020
sudo journalctl -b 0 -u cups
-bash: journalctl: command not foundIf I manually power off and power on the printer it works and starts the pending prints.
Thus my requirement is to have linux MacOS commands for the below tasks:
1. Reset / Restart the printer using command-line
2. Reprint the Printer Queue
Kindly help.
Code:lp -d Brother_HL_L2350DW_series /var/pdfs/11.pdfAfter 2 or 3 days the printer stops to print and I see the printer queue growing with the error message The printer is not responding. See below snapshot:
https://ibb.co/XYF9VFh
Code:tail /var/log/cups/error_log
E [26/Apr/2021:13:38:45 +0200] [Job 15850] The printer is not responding.
E [26/Apr/2021:13:39:45 +0200] [Job 15850] The printer is not responding.
Rustems-iMac:~ rustemince$ lpstat -a
Brother_HL_L2350DW_series accepting requests since Mo 26 Apr 13:24:09 2021
Brother_HL_L2350DW_series_2 accepting requests since Fr 9 Apr 15:28:24 2021
Canon_TS700_series accepting requests since Mo 26 Apr 15:00:32 2021
HP_LaserJet_M203_M206 accepting requests since Sa 3 Apr 09:24:54 2021
HP_LaserJet_M203dw__5F40D6_ accepting requests since Mo 29 Mar 12:26:13 2021
Kyocera_ECOSYS_M5526cdw accepting requests since Di 6 Apr 18:27:08 2021
Kyocera_ECOSYS_M5526cdw_b_3_Fax accepting requests since Di 7 Jan 21:51:33 2020
sudo journalctl -b 0 -u cups
-bash: journalctl: command not foundIf I manually power off and power on the printer it works and starts the pending prints.
Thus my requirement is to have linux MacOS commands for the below tasks:
1. Reset / Restart the printer using command-line
2. Reprint the Printer Queue
Kindly help.