Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a solution, either win or linux, for printing existing PDFs to network printers (available via our windows print server), preferrably by a 'hot folder' means where I could programatically or manually add PDFs to a folder for "printer x" and the pdf would print to that printer. I'm not sure if this is doable via CUPS, or if some other solution exists.

The key here is, the PDFs already exist. This isn't a 'use a print-to-pdf driver in CUPS' question, but could easily be mistaken for one on first glance. it's a 'print the PDF to a printer' question.

Any suggestions? Open-source would be preferrable.

share|improve this question
Are you talking about Windows Clients? You know you can open a printer and then drag and drop files into it to print them, right? – TheCleaner May 3 '12 at 18:12
up vote 3 down vote accepted

For Linux systems try incron (part of the inotify family). It can watch directories and take action on file changes. There's a (rather old) example on howtoforge. Just create an incrontab line like

/pdf_folder/ IN_MODIFY lp -d PDF_PRINTER $@/$#
share|improve this answer
I dl'd incron and it's just what I'm looking for. While my final solution isn't place, a test bash script bound to a 'hot folder' confirms this is gonna work as the solution. – Alan M May 7 '12 at 21:49

You can definitely do that; you should build it out of lp and either ls or find. The general logic would be to use a shell script in a cronjob which, for each entry in a list of files, passes the filename to lp (with options; you could even use awk and find to extract the directory name a file is in and use that as the destination printer).

share|improve this answer
It would help to lock the files before printing them, so that the next invocation of the cronjob would not print them again. – Dmitri Chubarov May 3 '12 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.