- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to duplicate a printer flow to a file ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2004 08:46 PM
тАО11-29-2004 08:46 PM
I have a remote printer that, sometimes, print strange data.
I don't know if the problem comes from the printer, the remote system (Windows nt4 workstation), wire or the hpux system (the application or unix).
I change everything, except the hp9000 system.
To diagnose, i want to duplicate the printer flow, to a file, and verify that the file also contains this strange caracters. How can i do that ?
Thank's in advance.
Olivier.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2004 10:10 PM
тАО11-29-2004 10:10 PM
Re: How to duplicate a printer flow to a file ?
Ive been thinking and can only see (for now) one solution:
- You disable the printer before the print.
- send the request.
- You go to /var/spool/lp/request/lp-name
- you make quick a copy of the files in your working directory
- enable the printer so it prints the request
Now you have the copies you can look at - I dont know if you can put that in a script to execute pehaps as an alias...
In my test I got 2 files:
printer "lpvbe" now disabled
momo:sm/doc # cat reactivate_acct |lp -onb -dlpvbe
request id is lpvbe-3761 (standard input)
momo:sm/doc # cd /var/spool/lp/request/lpvbe
momo:request/lpvbe # ll
total 4
-r--r----- 1 lp lp 94 Nov 30 11:54 cA3761momo
-r--r----- 1 lp lp 113 Nov 30 11:54 dA3761momo
momo:request/lpvbe # file *
cA3761momo: ascii text
dA3761momo: awk program text
momo:request/lpvbe # more cA3761momo
Hmomo
Proot
Jlpvbe-3761
C
Lroot
B
K1
Onb
T
FdA3761momo
fdA3761momo
UdA3761momo
N
A0
momo:request/lpvbe # more dA3761momo
In this I have the original document to be printed...
Hope it helps...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-30-2004 12:05 AM
тАО11-30-2004 12:05 AM
Re: How to duplicate a printer flow to a file ?
# touch /tmp/printfile
# chmod 644 /tmp/printfile
# chown lp:lp /tmp/printfile
# lpshut
# lpadmin -pprinter_name_here -mdumb -v/tmp/printfile
# /usr/lib/lpsched
# /usr/lib/accept printer_name_here
# /usr/bin/enable printer_name_here
Test it.
# /usr/bin/lp -dprinter_name_here /etc/copyright
If you routinely clean out /tmp, you may want to create /dev/printfile instead of /tmp/printfile. (that could be dangerous though) Call these whatever you'd like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2004 01:00 AM
тАО12-01-2004 01:00 AM
Re: How to duplicate a printer flow to a file ?
Victor : i don't know when the problem will occur, so i have to duplicate file to print everytime, not just one time, when i want ..
Cheryl : i want also to print twice my documents : to the file, AND to the printer !
Not just to a file.
Any other idea ?
Thank's in advance,
Olivier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2004 02:08 AM
тАО12-01-2004 02:08 AM
Re: How to duplicate a printer flow to a file ?
cat some_file_to_print | tee /var/tmp/prnfile | lp -d...etc...
Now the tee command simply stores the some_file_to_print into prnfile, but I suspect that some of your printing is from an application and you can't control how it prints.
So the other way to monitor the tasks is to enable the lp logging (stop lp with lpshut, then restart it with lpsched -v) and when the problem printing occurs, make a note of the time and then look in the /var/adm/lp/log file for a matching job.
Another suggestion is to post some samples of the strange data. Is it a series of ASCII strings, perhaps starting with the word PS or Postscript? If so, then some application is generating Postscript and the printer does not have a Postscript interpreter installed. Or someone is just printing anything on the HP side (including binary and executable files) which generates random characters and lots of almost blank pages.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2004 02:18 AM
тАО12-02-2004 02:18 AM
Re: How to duplicate a printer flow to a file ?
1) you're rigth when saying "i suspect that some of your printing is from an application and you can't control how it prints", so tee is not usable here,
2) lp is already in log mode. The log file just contains the date and hour of the request, and this is not an important information (not always the same !).
3) Data that are printed are only text data :
Before : 02/12/04-08:55:04 - Equipement X is doing task Y
After : 8?/98/:88<(8>:989?(((0:9:8(((├Г IM(M=::(XZI[M(MN(KMOX\M
Any other idea ?
Olivie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2004 03:08 PM
тАО12-02-2004 03:08 PM
SolutionThe only way to copy the the data file is to add cat within the model script for the printer. Remote printers all use the same rlp script. Look at the end of the script and you'll see a line line this:
/usr/sbin/rlp -I$requestid $BSDC ...
Just insert
cat $1 > /somefile
to copy the printfile. Now this will just overlay /somefile for each print job which may not be what you want. Change the /somefile to something like:
cat $1 > /var/tmp/${requestid}.$$
Each print file will have the spooler request id plus the PID of the script when it runs. NOTE: /var/tmp should be very large (several hundred megs) or better yet, specify a special mountpoint for the files.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2004 11:07 PM
тАО12-02-2004 11:07 PM
Re: How to duplicate a printer flow to a file ?
Just to wait now, for a bad printer job, and analyse the data ...
Thank's !
Olivier.