I want to enable a printer every 2 min. (it gets disabled for no reason after some time)
I have done a cron job in crontab :
*/2 * * * * cupsenable -E myPrinterBut printer keeps being disabled.
the command cupsenable -E myPrinter works when I run it.
1 Answer
cron uses a minimal PATH (only /usr/bin and /bin, by default), so you need to provide it either in the command or as a parameter in cron.
*/2 * * * * /usr/sbin/cupsenable -E myPrinter===
I would suggest to check the log files in /var/log/ for a log file that gets updated when this happens and check why the printer is getting disabled. You might have a network problem or it might be the printer telling the system it has a problem. That problem is likely logged in /var/log/syslog.
2