How to enable a printer every 2 min with crontab

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 myPrinter

But 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like