Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I save a print job? in unix

Status
Not open for further replies.

shinga

Technical User
Sep 24, 2001
9
0
0
LT
how do i view the contents of a print job from unix. i need to be able to view the contents of jobs in the queue so i can save soft copies of the print jobs.please provide answer for SCO Openserver release 5 and release 4.0
 
From
How can I get the file from the print spooler before it prints?

Sometimes you want the results of a print job so that you can e-mail it to someone else, import it into a Word Processing document or whatever. This is simple to do.

Put the printer OFF-LINE as described above. Alternately, if you have not yet printed, "disable" the printer (see above). Now

cd /usr/spool/lp/temp
l [0-9]*-* | more


You will see something like this:

rw-rw---- 1 lp lp 71 Dec 1 09:15 178-0
rw-rw---- 1 lp lp 83 Dec 1 09:16 179-0
rw-rw---- 1 lp lp 7809 Dec 1 09:15 179-1


Your dates and sizes will be different, as will the names of the files.

These files are information about what is to be printed and how. For example, if you looked at that 178-0 file on my machine, you'd find it contained:

C 1
D myprinter
F /etc/passwd
P 20
t simple
U root
s 0000
l C_C.C
m C_C.C


while the 179-0 had this in it:

C 1
D myprinter
F /usr/spool/lp/temp/179-1
P 20
t simple
U root
s 0000
l C_C.C
m C_C.C


Notice the difference between the two. You might have already guessed that the "C" line is the number of copies, the "D" is the printer it's going to print on, and the "U" is the user who printed it. The "F" is the file that will be printed, and if it was generated as the result of program output (as opposed to "lp /etc/termcap"), it will refer to another file in this directory.

If you have more than one print job, you might not know which file is the one you want. If the size of the -1 files combined with the destination and user isn't enough to help you, then examine each -1 file in turn. Once you have what you want, copy the file wherever you want it. If you don't want it to print after that, cancel it. For example, I might say:

cp /usr/spool/lp/temp/179-1 /tmp/printfile
cancel myprinter-179


Lpd style printing doesn't put files here: you'll find those in /var/spool/lpd/printername or wherever else /etc/printcap points at.

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
thanks once again, Tony you are a help is vital

shinga
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top