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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set up print to file as an "LPx" device

Status
Not open for further replies.

Klick

MIS
Dec 12, 2001
64
US
We currently use a huge line printer for various reports from the AIX 4.3.5 system. There are many custom COBOL programs and a menuing system allowing users to select a printer number. The line printer is leaving us. I have to create an alternative.

My idea is simply to send all output to a directory, then allow users to pick reports from that directory and view them in a Windows report viewer (which we own) and subsequently print to a laser from the report viewer.

How do I create a device/queue called LP6 which users can select to send these reports?
 
Create your own script to send input file to a file system with either copy or ftp if Microshaft server. Then create a printque using that program as a backend program.
 
This is fairly easy to do.

First create a file in /dev like /dev/lpx set the permissions so that anyone can write and read to it, and then create a local printer. When asked for the device name use 'lpx' and it will print to this file. You can have other names as well. This has some complications. In AIX 4 and later you can create queues to print to a file from the main menus.

The printing for Fun and Profit at AIX 5L talks about using this technique as a troubleshooting guide. See the IBM redbooks at
 
hi,

Create a "user defined backend" queue, then, write a script
to send file in a "place" .

1) smitty spooler / add a ... / other User defined backend

Queue = LP6
Device = LP6d
Backend Program = /home/bin/myscript.ksh

2) touch /home/bin/myscript.ksh
chmod a+x /home/bin/myscript.ksh
vi /home/bin/myscript.ksh

/home/bin/myscript.ksh
-----------------------
#!/usr/bin/ksh

TIME=.....
DATE=.....
AREA=/home/area
cp $1 $AREA/$DATE$TIME${USER}.txt

----------------------------------------------

To complete job, jou can install Samba on your system:
so you can send the file on a Windows server, without
activate on it FTP

/usr/local/bin/smbclient //$WINHOST/$WINPRIN -P -c "put $TMPFILE"

This line was to print: see doc of smbclient.

B Y E
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top