Friday, March 03, 2006

Creating my own printing spool

The OIT (Office of Information Technology) provides a PostScript massive printing service called central-ps, of which there is no quota limitation but can only print two side black and white printings. Besides, there is usually three delivery times per day that the printouts are delivered to the public bins and people can pick up their printous at there.

This service is quite usefull for me, especially for that I have lots of documents to print in this semester. There are basically three ways to submit jobs to the central-ps printing queue:
The first one is the most straight-forward method that requires no file format converting. However, OIT seems to have no plan to allow the printer sharing to all IPs within the campus. Although it requires file converting for the remaining two methods, the web printing is also convenient. But there are some scripting error within the web printing pages that it always causes the browsers other than IE to complain that there is a time-consuming script by continuing running which the system could stop responding. It is not effect for the print jobs if stop the script, but it feels bad to see some kind of message like this. The last one seems to be the most sophisticated one for submitting jobs, but, since the command line is one of the most powerful tool for UN*X, I can play some fun game with this!

The idea is simple:
  1. Write a script that monitors a specific directory. If there are PostScript files in that directory, submit them with prnt command, move the success files into other directory, also move the failed ones into another directory, and mail a notice to me.
  2. Schedule a cron job that execute that script every 10 minutes.
After setting up this, I have a "private print spool" that automatically submits the files! All I have to do now are just converting the file, transfer the file to that directory, and then pick up the printouts after the delivery time!

UN*X and command line rocks!

No comments: