Raspberry Pi: Schedule Print Job

After having a couple sets of ink cartridges dry up on me after extended non-use, I learned that I’d need to print something regularly to keep my cheap inkjet printer working. After ignoring a few of my own reminders to print a test page manually, I decided to create an automated solution using a cron job on a Raspberry Pi I already have running on my home network.

To send the file to the printer, I used CUPS (documentation here or here). I followed the tutorial here to get it installed and activate the web interface.

With the printer added, I ran lpstat -p -d to get the exact name of the printer, then lp -d <printer> <file> to send a file to the printer.

To add the weekly cron job, I ran crontab -e and added the following line to get it to print weekly at noon on Sundays:

0 12 * * Sun lp -d HP_DeskJet_printer Sample.pdf

 

One Reply to “Raspberry Pi: Schedule Print Job”

  1. Hi Michael, thanks for posting this solution. Im trying to do the same as my printer keeps drying up. Question on this method, does the pdf file you’r saving located in the raspberry pi, if so what directory should i save it in?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.