Re: Printing lots of pages skips a few

2022-02-02 Thread Pankaj Jangid
mick crane  writes:

> May be an issue with the printer reporting it has printed file when it
> hasn't.
> Perhaps try wait between each print instruction.
>

This could be one reason. But I am not sure how to diagnose
this. Perhaps the procedure suggested by David is a good starting point.

Regards ~Pankaj



Re: Printing lots of pages skips a few

2022-02-02 Thread Pankaj Jangid
David Wright  writes:

> And in the OP's case, this might save a little effort, because my
> next step in the investigation would be to check the files in
> /var/spool/cups/c* to make sure that all the files had actually
> been queued. If so, what does each file report as happening.
> (The files are timestamped, so their later repeat printings can
> be discounted.)
>
> The OP might want to sort on date and/or sequence number if they
> were going to bother to sort at all. The sort options are
> complicated a little by the choice of ddmmyy, rather than yymmdd,
> for the date field.
>

Thanks for these pointers, David. Today I am travelling. Tomorrow, I’ll
definitely diagnose using the procedure outlined by you.

Regards ~Pankaj



Re: Printing lots of pages skips a few

2022-02-02 Thread David Wright
On Tue 01 Feb 2022 at 07:29:09 (-0500), Greg Wooledge wrote:
> On Tue, Feb 01, 2022 at 03:04:06PM +0530, Pankaj Jangid wrote:
> > I tried to print ~40 pages using the following combination of commands:
> > 
> > find . -name "pref***.pdf" | xargs lp
> > 
> > The result was that a couple of pages were missed.
> 
> That command is fundamentally broken.  It will fail if any of the
> matching filenames contain whitespace, single quotes or double quotes.
> 
> A correct version would be:
> 
> find . -name "pref*.pdf" -exec lp {} +
> 
> That's the preferred one.  If you're really old-fashioned and just cannot
> live without xargs, the first thing you must realize is that POSIX xargs
> is fundamentally incapable of doing this correctly.  GNU xargs has a -0
> extension, though, which makes it possible:
> 
> find . -name "pref*.pdf" -print0 | xargs -0 lp
> 
> That one is acceptable, albeit longer, less efficient and less portable.

(… goes off to check .bashrc, and comes back …)

I find frequent use of xargs, and they're almost all on account of

needing  …  -print0 | LC_ALL=C sort -z | xargs -0 …  (± the locale).

And in the OP's case, this might save a little effort, because my
next step in the investigation would be to check the files in
/var/spool/cups/c* to make sure that all the files had actually
been queued. If so, what does each file report as happening.
(The files are timestamped, so their later repeat printings can
be discounted.)

The OP might want to sort on date and/or sequence number if they
were going to bother to sort at all. The sort options are
complicated a little by the choice of ddmmyy, rather than yymmdd,
for the date field.

Cheers,
David.



Re: Printing lots of pages skips a few

2022-02-02 Thread Curt
On 2022-02-02, mick crane  wrote:
>> 
>> Also I could identify and print those files separately; using "lp
>> ".
>
> May be an issue with the printer reporting it has printed file when it 
> hasn't.  Perhaps try wait between each print instruction.

It would be edifying to examine, at the very least, the actual command
used rather than the substituted "example" command given (for reasons
which escape your corresondant), as well as a list of the files that
failed to print.


> mick
>






Re: Printing lots of pages skips a few

2022-02-02 Thread mick crane

On 2022-02-02 10:42, Pankaj Jangid wrote:

Klaus Singvogel  writes:


Can you look at the webinterface of CUPS regarding the missing jobs?

http://localhost:631/

-> Printer -> select your default printer (if more) -> finish job (or
similar)


I did that when I discovered that some pages were missing. Nothing 
there

in unfinished jobs.

Also I could identify and print those files separately; using "lp
".



May be an issue with the printer reporting it has printed file when it 
hasn't.

Perhaps try wait between each print instruction.

mick

--
Key ID4BFEBB31



Re: Printing lots of pages skips a few

2022-02-02 Thread Pankaj Jangid
Klaus Singvogel  writes:

> Can you look at the webinterface of CUPS regarding the missing jobs?
>
>   http://localhost:631/
>
> -> Printer -> select your default printer (if more) -> finish job (or
> similar)

I did that when I discovered that some pages were missing. Nothing there
in unfinished jobs.

Also I could identify and print those files separately; using "lp
".

Regards ~Pankaj



Re: Printing lots of pages skips a few

2022-02-02 Thread Pankaj Jangid
Greg Wooledge  writes:

> I can't help noticing that none of your filenames begin with "pref",
> so none of them actually match the -name pattern that's being given
> to find.  One of the obvious ways you could experience this problem
> is that the "missing" files don't match the pattern you're using.

That "pref" was just an example in the original post. I none of the
files bypassed the pattern.

> Beyond that, perhaps some of the files are empty (either literally
> zero bytes, or they contain only "comments" or metadata that doesn't
> cause the generation of images using ink on paper when printed).
>
> Or... the files aren't readable due to permissions.  Or they're not in
> the directories you think they're in.
>
> Can you identify *which* files aren't being visibly printed?  By process
> of elimination, you should be able to find out.  Pick one of them, and
> analyze the situation.  If it's not an issue with the name, location or
> permissions, then try to open it with a PDF viewer.  If it opens correctly,
> try printing it with "lp".

I could identify and print those files separately later, using "lp
" command.



Re: Printing lots of pages skips a few

2022-02-01 Thread Klaus Singvogel
Pankaj Jangid wrote:
> 
> In my case though, I had verified that the output of find is okay for
> xargs. Then I added | xargs lp.
> 
> But could this be cause of missing page. The output of find is:
> 
> --8<---cut here---start->8---
[...]
> --8<---cut here---end--->8---
> 
> six of them were not printed.

Can you look at the webinterface of CUPS regarding the missing jobs?

http://localhost:631/

-> Printer -> select your default printer (if more) -> finish job (or similar)

Regards,
Klaus.
-- 
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D  1994-06-27



Re: Printing lots of pages skips a few

2022-02-01 Thread Greg Wooledge
On Tue, Feb 01, 2022 at 10:42:31PM +0530, Pankaj Jangid wrote:
> Greg Wooledge  writes:
> > A correct version would be:
> >
> > find . -name "pref*.pdf" -exec lp {} +

> Thanks for this brief course, Greg. I really liked it.
> 
> In my case though, I had verified that the output of find is okay for
> xargs. Then I added | xargs lp.
> 
> But could this be cause of missing page. The output of find is:
> 
> --8<---cut here---start->8---
> 2018/letters/060718I049905433.pdf
> 2018/letters/250518I049904099.pdf
> 2018/letters/150918I049901510.pdf
[..]

OK.  Then there must be something else wrong.

I can't help noticing that none of your filenames begin with "pref",
so none of them actually match the -name pattern that's being given
to find.  One of the obvious ways you could experience this problem
is that the "missing" files don't match the pattern you're using.

Beyond that, perhaps some of the files are empty (either literally
zero bytes, or they contain only "comments" or metadata that doesn't
cause the generation of images using ink on paper when printed).

Or... the files aren't readable due to permissions.  Or they're not in
the directories you think they're in.

Can you identify *which* files aren't being visibly printed?  By process
of elimination, you should be able to find out.  Pick one of them, and
analyze the situation.  If it's not an issue with the name, location or
permissions, then try to open it with a PDF viewer.  If it opens correctly,
try printing it with "lp".



Re: Printing lots of pages skips a few

2022-02-01 Thread Pankaj Jangid
Greg Wooledge  writes:

> On Tue, Feb 01, 2022 at 03:04:06PM +0530, Pankaj Jangid wrote:
>> I tried to print ~40 pages using the following combination of commands:
>> 
>> find . -name "pref***.pdf" | xargs lp
>> 
>> The result was that a couple of pages were missed.
>
> That command is fundamentally broken.  It will fail if any of the
> matching filenames contain whitespace, single quotes or double quotes.
>
> A correct version would be:
>
> find . -name "pref*.pdf" -exec lp {} +
>
> That's the preferred one.  If you're really old-fashioned and just cannot
> live without xargs, the first thing you must realize is that POSIX xargs
> is fundamentally incapable of doing this correctly.  GNU xargs has a -0
> extension, though, which makes it possible:
>
> find . -name "pref*.pdf" -print0 | xargs -0 lp
>
> That one is acceptable, albeit longer, less efficient and less portable.

Thanks for this brief course, Greg. I really liked it.

In my case though, I had verified that the output of find is okay for
xargs. Then I added | xargs lp.

But could this be cause of missing page. The output of find is:

--8<---cut here---start->8---
2018/letters/060718I049905433.pdf
2018/letters/250518I049904099.pdf
2018/letters/150918I049901510.pdf
2018/letters/180518I049903135.pdf
2018/letters/180518I049902524.pdf
2018/letters/191018I049905432.pdf
2018/letters/300718I049902173.pdf
2018/letters/141218I049903816.pdf
2018/letters/261018I049903737.pdf
2018/letters/290618I049904628.pdf
2018/letters/190718I049902138.pdf
2018/letters/230718I049900093.pdf
2018/letters/030818I049903843.pdf
2018/letters/190118I049901374.pdf
2018/letters/150618I049903232.pdf
2018/letters/281218I049903776.pdf
2018/letters/190118I049901373.pdf
2018/letters/240818I049904062.pdf
2018/letters/121218I049903419.pdf
2018/letters/201118I049900883.pdf
2018/letters/021118I049904149.pdf
2018/letters/111018I049901537.pdf
2018/letters/270718I049903199.pdf
2018/letters/211218I049904184.pdf
2018/letters/180518I049902534.pdf
2018/letters/261118I049905674.pdf
2018/letters/210918I049902234.pdf
2018/letters/210918I049906208.pdf
2018/letters/230818I049902830.pdf
2018/letters/150518I049903258.pdf
2018/letters/261018I049903715.pdf
2018/letters/100918I049902331.pdf
2018/letters/180818I049904319.pdf
2018/letters/110518I049903217.pdf
2018/letters/290118I049905290.pdf
2018/letters/121018I049903705.pdf
2018/letters/170518I049901548.pdf
2018/letters/180818I049904094.pdf
2018/letters/191218I049901286.pdf
2018/letters/101018I049905261.pdf
2018/letters/021118I049904059.pdf
2018/letters/060118I049902467.pdf
2018/letters/150618I049903254.pdf
2018/letters/110518I049903022.pdf
2018/letters/270718I049903443.pdf
2018/letters/240818I049904852.pdf
2018/letters/210918I049906209.pdf
2018/letters/300518I049903175.pdf
2018/letters/280918I049901364.pdf
2018/letters/140918I049906491.pdf
2018/letters/010618I049902892.pdf
2018/letters/060618I049904019.pdf
2018/letters/070918I049903663.pdf
2018/letters/301118I049903918.pdf
2018/letters/261018I049901520.pdf
--8<---cut here---end--->8---

six of them were not printed.

Regards ~Pankaj



Re: Printing lots of pages skips a few

2022-02-01 Thread Greg Wooledge
On Tue, Feb 01, 2022 at 03:04:06PM +0530, Pankaj Jangid wrote:
> I tried to print ~40 pages using the following combination of commands:
> 
> find . -name "pref***.pdf" | xargs lp
> 
> The result was that a couple of pages were missed.

That command is fundamentally broken.  It will fail if any of the
matching filenames contain whitespace, single quotes or double quotes.

A correct version would be:

find . -name "pref*.pdf" -exec lp {} +

That's the preferred one.  If you're really old-fashioned and just cannot
live without xargs, the first thing you must realize is that POSIX xargs
is fundamentally incapable of doing this correctly.  GNU xargs has a -0
extension, though, which makes it possible:

find . -name "pref*.pdf" -print0 | xargs -0 lp

That one is acceptable, albeit longer, less efficient and less portable.