ITEM: J4272L

How can I specify the path of the back end output file




Question:

AIX 3.2.5
model 570

I have specified the path to the printer device for the backend output
file, and yet the output always goes to /usr/spool/qdeamon. What 
am I doing wrong?  (this is a link to /var/spool/qdaemon)

Response:

The path for the FILE= defines where the final file goes.  The directory
/var/spool/qdaemon is used to store temporary files when using the -c
(or copy) option when printing the file.  The lpr command automatically
uses this option, so use qprt or enq to print to avoid, or flag to
not copy.

The user does not really want to send data to a printer, but to a file
for each user.  I suggested multiple ways of doing this.
In each way, the files will concatinate on to end of file so needs cleaned
between jobs.

One is to create a virtual printer to device lpajh   - /dev/lpajh

> /dev/lpajh
mkvirprt
  1 - printer attached to host
        Select ASCII printer
        queue name lpajh
qprt -Plpajh filename
data is now in /dev/lpajh

Now you could link to this file from user directory file

Second way:  Use queue with backend /bin/cat, and FILE=/home/usrname/prtfile

> /home/usrname/prtfile
smit spooler
  manage local printer subsystem
        add a queue device
                enter queuename and device name
                backend file = /home/usrname/prtfile
                backend program = /bin/cat
qprt -Pqueuename filename
file is now in /home/usrname/prtfile

Third way is to make a shell script that does what you want as backend

1.  We can build a queue that simply cat's the file the file on
        the printer host (local system) and then enq's as a local file.
    - create directorys for path /tmp/var/spool/lpd with 777 permissions
    - create queue with following stanzas
      catq:
        device = lxx
        up = TRUE
      lxx:
        file = FALSE
        backend = /bin/sh /bin/catq.sh
    - create /bin/catq.sh
        enq -Ppclque ps2pcl        ! send file to send printer to pcl
        cp $1 > /tmp$1             ! Make temporary copy of file
        enq -c -Ppclque /tmp$1     ! print temp file with copy option
        rm /tmp$1                  ! Remove temp file.
        enq -Ppclque pcl2ps        ! Shift printer back to postscript
        !  The -c option on enq creates a copy of the file so we
                can erase our temp copy.



Support Line: How can I specify the path of the back end output file ITEM: J4272L
Dated: May 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:43
Comments or suggestions? Contact us