Third-party software does not run from cron

Dear community.

I'm at a dead end and I need someone to kick me in the back because I can't solve this problem myself.

The idea is simple - in order not to dry out the print head of the inkjet printer with the help of the printhelp applicator http://resetters.ru/index.php?showtopic=38584 you can periodically clean it (the head). So as not to have a headache and do it manually, without worrying about whether you forgot to do it yesterday or not and will not forget whether at least once a week, this can be done via the command line.

I wrote a script that I included in the startup. This script waits 24 hours (the time can be changed), and executes the command:

/usr/bin/printhelp --device="Epson L800" --action="cleaning"

And everything works as it should. It would seem that it works and works, and rejoice. But it's a crutch. Why do such things? I'm an experienced Linux user. For such needs, it is better to use cron. Only here the problem is that from under cron-and this command does not work. No for the execution of the command it is sent to the processor, but in fact the printer is not cleaned.

Please note that the path to aplikuha is complete. Please tell me what the cause may be and how to treat it? I am very grateful for all the ideas.

Author: Anton Shchyrov, 2018-06-21

2 answers

Allow me! The printer software itself parks the heads to the diaper, which would just not dry out... I personally have a Canon pixma ip4200 lying in the garage for several years. After that, I did only a few deep cleaning and calibration of the heads - and that's it! Still plowing...

 2
Author: Justicet, 2018-06-22 20:00:02

Thank you Roman, thank you Sergey. So it turned out right before the definition of the schedule, I specified DISPLAY=: 0.0 as recommended in this article. It was not necessary to export the variable, although you can export it, it will work both ways. As a result, the optional settings were mandatory because even though printhelp runs in console mode, but the program itself is X-based and somehow still requires X-files. I found out about it by redirecting output of a command called from cron to a separate text file:

/usr/bin/printhelp --device="Epson L800" --action="cleaning" > /var/log/printerClean.log 2>&1

Naturally, in the folder with logs, the printerClean.log file must already exist to have certain rights, as well as the owner and group. And the logs were simply too lazy to look for. And, in fact, in the printerClean.log file there were messages with direct text like "Volodya, shave off your mustache and raise your x's". Thank you to everyone who responded and I helped, I hope this thread will be useful to someone.

 0
Author: Eugen Stadnik, 2018-06-26 08:11:15