?
Solved

Pulling something back from the unix spooler

Posted on 2003-02-20
5
Medium Priority
?
224 Views
Last Modified: 2010-04-21
Greetings:

I'm hoping someone can help. I'm trying to write routine to retrive the text of a print job that has already been submitted to the lp subsystem for printing.

There is a 3rd party software program that we have no control over that sends its output (simple ASCII) to a particular queue, which has no printer physically attached. I'm looking for a way to retrieve that output. The directories and files of the lpd daemon (/var/spool/blah/blah/blah) are all owned by root (and I do not want this script to run as root), so I cannot simply copy the output with cp. I can, however, run it with the same userid as the spooling program.

Is there a way to "redirect" the output from a job awaiting printing? BTW, I'm running a recent version of DEC UNIX on this box.

Thanks

Jay
0
Comment
Question by:jalosa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
ellesd earned 1050 total points
ID: 7990104
Is all the output of the program sent to the spool?  If so, can you just redirect the output of the program?  If not, does it use lp to send the output, or does it do it on its own?  If so, you can write a wrapper for lp to detect the userid of the program and copy the file to wherever you want.  I'm sure there are other methods, but this is a start.  Let me know how the program is actually sending its output to the spool.
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 7993706
It will be easy to check this 3rd party documens of how to configure it's output.
If no docs, then search for any env setting at it's script.

good Luck
0
 

Author Comment

by:jalosa
ID: 7994389
Thanks for the replies, but the 3rd party installation is "hostile". I have no docs (don't even think they exist). Also a wrapper is not feasible for other reasons that I won't go into here (but good idea).

I need a command line or short script solution. I have no control over the job prior to it arriving in the queue. Is there no command to redirect the output for a job you own?
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 7995597
that means you are not the owner of this job. so who support this application if something going bad.
0
 
LVL 2

Expert Comment

by:ellesd
ID: 7996557
What exactly do you need to do with the print job? By "redirect", do you mean you are trying to send it to another printer or are you trying to make a copy of the actual file into another directory?  Try to give some more detail.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question