1855502 Members
3704 Online
104111 Solutions
New Discussion

name to printing

 
SOLVED
Go to solution
Vogra
Regular Advisor

name to printing

Hi All!
if I send a document to print, I do: lp -d doc_name, than I can see the status of queue with lpstat - doing it, I see the list below:
fax-2 root priority 0 Jan 29 17:54 fax 5273 bytes
fax-3 root priority 0 Jan 29 17:59 fax 5275 bytes
fax-4 root priority 0 Jan 29 18:04 fax 5274 bytes
fax-5 root priority 0 Jan 29 18:04 fax 5274 bytes;

...but I need to get a specific name of the job from each document that I sent to printer.
How can I?
Thanx in advance,

We are spirits in the material world
3 REPLIES 3
Helen French
Honored Contributor

Re: name to printing

Hi,

'lpstat -o' will list you the status of all output requests. Each request will be assigned with a specific job_id.

Also 'lpstat -t' will give you a full information. You can grep the parameter you needed.

HTH,
Shiju
Life is a promise, fulfill it!
Vogra
Regular Advisor

Re: name to printing

Wilson,
in /var/spool/lp/request/fax - I can see the documents that I get to print, like the list below:
( dA0009vsurjux1
dB0009vsurjux1
dC0009vsurjux1)
I want to change the first part of name of file (excluding the server name VSURJUX1). Than the list could be: name_I_want_vsurjux1, where "name_I_want_" is the parameter that I used in ->lp -dfax filetoprint

thanx,
We are spirits in the material world
Bill Hassell
Honored Contributor
Solution

Re: name to printing

Once the lp spooler accepts a job for printing, the name of the original file is available only in the control file located in the individual printer's directory in /var/spool/lp/request. lpstat cannot retrieve the control file details. You could, however, write a script to report the details from the control files. Use the line that starts with N as the name of the original file.

Now the name fax seems to indicate that this is not a standard printer but a fax subsystem. In that case. you may need additional details concerning the way the fax works in order to extract the original file names.


Bill Hassell, sysadmin