If you want to set up spooler to print on a remote printer, you can pipe the print job to lpr.
This takes advantage of the fact that the filter sends the print job to the printer; you just name the remote printer in the filter command line of the configuration file used by spooler.
To try it, first get your remote printer working using lpr (see "Remote printing to a TCP/IP-enabled printer using lpr"), then do the following:
cp /etc/printers/ps.cfg /etc/printers/test.cfg
Filter = phs:$d:phs-to-ps Filter = raw:$d:cat
These filter command lines are in the form:
source:destination:filter
The phs filter command line tells the filter to process .phs files by sending them through a filter called phs-to-ps before sending them on to the destination passed by spooler. The raw filter command is for utilities that already produce the correct output for the printer.
Filter = phs:$d:phs-to-ps
to this:
Filter = phs:ps:phs-to-ps
Filter ps:$d:lpr -Prlpt2
What you've done is change the destination from that given by spooler to ps, so that after the .phs file has been converted to a ps type by phs-to-ps, it goes to the ps filter. Then the ps filter line you added sends PostScript files to lpr, forcing output to the remote printer (just as you did in "Remote printing to a TCP/IP-enabled printer using lpr").
You might be wondering what happened to the destination passed by spooler ($d). Well, that is discarded because lpr (unlike phs-to-ps) doesn't return the job to the filter but completes it itself.
spooler -d /dev/null -c /etc/printers/test.cfg -n rlpt2 &
The -n option specifies the name of the printer.
Now, you should be able to print your PostScript file on your remote TCP/IP-enabled printer.
Copy the print file to the directory that spooler uses:
cp /root/my_file.ps /dev/printers/rlpt2/spool/