Retrieving files from print queue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Retrieving files from print queue
# 1  
Old 06-19-2008
Retrieving files from print queue

Hi,

wonder if anyone can help me out with this. I'm trying to retrieve files from a print queue on a remote server i.e. get files before they are printed. I'll be using perl to do this. I've written out some pseudocode below:

Telnet to print server
for ever (endless loop)
pause 1 second
run lpq command
parse output from lpq command
if there are any files in print queue
get list of files (how do we do this ????????)
for every file in print queue
ftp file to 'our' server
endfor
endif
endfor


Basically I cannot write any code on the remote server to do this I have to do it all using my own script on 'our' server. Does anyone know how I can actually retrieve the files from the print queue?

Any help would be much appreciated. Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Print queue problems

I am using AIX 5. Just swapped over an HP printer. The old printer was on a JetDirect box. The new printer connects directly to the network. Using the same IP address to print to, so the only alteration I made was to edit the etc/qconfig file to alter the port setting from 9103 to 9100. I can... (2 Replies)
Discussion started by: charding
2 Replies

2. UNIX for Advanced & Expert Users

[Solved] remove all print jobs from a print queue

Hello, Sometimes i need to clear all the jobs of a print queue and it is really annoying to cancel one by one. Is there a way to cancel all print jobs for a specific print queue with a single command instead of cancelling them one by one? My AIX system is 5.3 Thank you for your attention (2 Replies)
Discussion started by: omonoiatis9
2 Replies

3. AIX

Retrieving printer queue properties

Hi everyone! I've been stuck with a job I'm struggling with. A while back we loaded a large number of printer queues into our AIX environment through smit. Since then some of the details have gone astray, including full details on the older printer queues. I need to gather together details on... (2 Replies)
Discussion started by: aoverbury
2 Replies

4. AIX

Print queue setup

Hi I had setup a print queue named test in the AIX server. When I try to print 96 char per line.. it prints only 80 and the rest is skipped to the next line. however there are 16 spaces left as blank in the first line any help is appriciated (0 Replies)
Discussion started by: antointoronto
0 Replies

5. AIX

Print queue restriction

Hi, I'm at AIX 5.3, I have a print queue named chqprinter, I want to allow access to print only 2 users to that print queue, jobs printed by all other users to above queue should be deleted. Any idea how to achieve that? ---------- Post updated at 10:33 AM ---------- Previous update was at... (5 Replies)
Discussion started by: tayyabq8
5 Replies

6. Solaris

Print to ps2pdf print queue

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (2 Replies)
Discussion started by: Sean_69
2 Replies

7. UNIX for Dummies Questions & Answers

Print to a ps2pdf print queue.

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (1 Reply)
Discussion started by: Sean_69
1 Replies

8. AIX

AIX 5 print queue

I have setup a printer and queue using SMIT and I have set the default tray to 4. What I am trying to find out is if there is a way to set the next tray it trys to use if tray 4 is empty to tray 3, then tray 2, then tray 1. (0 Replies)
Discussion started by: chefsride
0 Replies

9. UNIX for Dummies Questions & Answers

Problem with print queue

I have a problem with a print queue that keeps going down on me every couple of days. When it happens I run an 'enable' and all is fine for a few more days. Can anyone can tell me where to start looking to debug this problem as i am new to UNIX Thanx (1 Reply)
Discussion started by: carell
1 Replies

10. UNIX for Dummies Questions & Answers

Print Queue Problems

Hi All Does anyone know what is meant by PRINTER STATUS CONNECT concerning print queues? At work we run a Perle/Connectix JetStream 8500 (RJ45 Model) to connect our dot matrix printers and often we get the Connect Status. Nobody I speak to knows what the status means. When the printer... (0 Replies)
Discussion started by: nickbungus
0 Replies
Login or Register to Ask a Question
lpq(1B) 					     SunOS/BSD Compatibility Package Commands						   lpq(1B)

NAME
lpq - display the content of a print queue SYNOPSIS
/usr/ucb/lpq [-P destination] [-l] [ + [interval]] [ request-ID...] [user...] DESCRIPTION
The lpq utility displays the information about the contents of a print queue. A print queue is comprised of print requests that are waiting in the process of being printed. lpq displays the following information to the standard output: o the username of the person associated with a print request, o the position of a print request in the print queue, o the name of file or files comprising a print request, o the job number of a print request, and o the size of the file requested by a print request. File size is reported in bytes. Normally, only as much information as will fit on one line is displayed. If the name of the input file associated with a print request is not available, the input file field indicates the standard input. The print client commands locate destination information using the printers database in the name service switch. See nsswitch.conf(4), printers(4), and printers.conf(4) for details. OPTIONS
The following options are supported: -P destination Displays information about printer or class of printers (see lpadmin(1M)) . Specify destination using atomic or POSIX-style (server:destination) names. See printers.conf(4) for information regarding the naming conventions for atomic names and standards(5) for information regarding POSIX. -l Displays information in long format. Long format includes the name of the host from which a print request originated in the display. + [interval] Displays information at specific time intervals. Stops displaying information when the print queue is empty. Clears the screen before reporting displaying the print queue. Specify interval as the number of seconds between displays. If inter- val is not specified only executes once. OPERANDS
The following operands are supported: request-ID The job number associated with a print request. user The name of the user about whose jobs lpq reports information. Specify user as a valid username. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. FILES
/var/spool/print/[cd]f* Spooling directory and request files for jobs awaiting transfer. /var/spool/lp/* LP print queue $HOME/.printers User-configurable printer database /etc/printers.conf System printer configuration database printers.conf.byname NIS version of /etc/printers.conf printers.org_dir NIS+ version of /etc/printers.conf ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscplp | +-----------------------------+-----------------------------+ SEE ALSO
lp(1), lpc(1B), lpr(1B), lprm(1B), lpstat(1), lpadmin(1M), nsswitch.conf(4), printers(4), printers.conf(4), attributes(5), standards(5) SunOS 5.10 23 May 2003 lpq(1B)