Operating System - HP-UX
1834167 Members
2370 Online
110064 Solutions
New Discussion

Amount of print request that can send to printer using lp

 
SOLVED
Go to solution
Dhananjaya Amarakoon
Regular Advisor

Amount of print request that can send to printer using lp

Hi Friends...

Any one know how to change the number of request file that given to lp command?

I want to send large number of files to printer for printing. It may be around more than 2000. But when I issue the command it will give following error messsage.

lp bill_set_pri*
lp: Too many request files

Is there any variable to setup this size?
or any option to change it ?
How to know defalt size that can send to printer ?

Hope to see your answer

Thanks & Regards
Dhananjaya Amarakoon.
3 REPLIES 3
Heiner E. Lennackers
Respected Contributor

Re: Amount of print request that can send to printer using lp

I cannot tell you the exact number of arguments the lp command can handle, but there is a common solution for this kind of problems.

$ echo bill_set_pri* | xargs lp

HeL
if this makes any sense to you, you have a BIG problem
Bill Hassell
Honored Contributor
Solution

Re: Amount of print request that can send to printer using lp

There are several potential limits for the number of files for a single lp request. The first is the length of the command line. lp does not know anything about * -- it is pre-processed by the shell and lp sees only the expanded list of filenames. But it the list won't fit on the line, the shell will report "line too long". The fix is easy: select a smaller group of filenames

The next limit is disk space on /var -- all the files must be copied to /var/spool/lp/request. If you need more space, make a separate lvol for the request directory.

A third limit may be a combination of internal code in lp and the FIFO mechanism used by lpsched. lp may have an internal limit inherited from more than 20 years ago. This is a good possibility since the error message appears to come from lp itself.

A final limit is print job sequence numbers. If the printer is a remote BSD printer, the sequence number is only 3 digits. That means that 2000 file will wrap around several times. If the print requests are created like: myprn-998 myprn-999 myprn-1 then 999 requests will be the max. Now if your remote printer is SysV style then there are 4-digit sequence numbers. But realize that using up all the sequence numbers (ie, 9999 files) means no else can submit a print job until some are printed. And the previous limits are still in effect.

Rather than take the easy way out (lp file*), write a concatenation script to manage the print jobs. Your script will select a few hundred files, then concatenate them into a single file with page separators, then print that file. Repeat as needed for 2000 files.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Amount of print request that can send to printer using lp

>HeL: $ echo bill_set_pri* | xargs lp

And if it is too long for echo, you can use find:
$ find . -name "bill_set_pri*" | xargs lp
$ find . -name "bill_set_pri*" -exec lp +