A
A
Alexander2021-07-28 18:32:08
linux
Alexander, 2021-07-28 18:32:08

The command is partially executed. How to fix the error?

I connected an old fujitsu fi-6770A scanner via USB to Centos7. Installed: PHP 7.3, Sane, phpSane.
PHP creates and runs the script:

/usr/bin/scanimage -d "fujitsu:fi-6770dj:498" -l 0mm -t 0mm -x 210mm -y 296.926mm --mode "Gray" --resolution 200dpi --brightness 0 --contrast 0 --source "ADF Front" --format=tiff --batch='./tmp/out_517771_%d.tif' --batch-start=10 && /usr/bin/convert './tmp/out_517771_*.tif' -compress jpeg -quality 90 -density 200 pdf:- > './output/scan_2021-07-28_13.33.16.pdf'

TIFF files are created. The second part of the script is not executed.
Through SSH in the console:
su -m apache -c '/usr/bin/convert './tmp/out_517771_*.tif' -compress jpeg -quality 90 -density 200 pdf:- > './output/scan_2021-07-28_13.33.16.pdf''

PDF created.
For a console test:
su -m apache -c '/usr/bin/scanimage -d "fujitsu:fi-6770dj:498" -l 0mm -t 0mm -x 210mm -y 297mm --mode "Gray" --resolution 200dpi --brightness 0 --contrast 0 --source "ADF Front" --format=tiff --batch='./tmp/out_511_%d.tif' --batch-start=10 && /usr/bin/convert './tmp/out_511_*.tif' -compress jpeg -quality 90 -density 200 pdf:- > './output/scan_2021-07-28.pdf''

And I get a possible answer why the second part does not work:
Scanning page 16
Scanned page 16. (scanner status = 5)
Scanning page 17
scanimage: sane_start: Document feeder out of documents


Document feeder out of documents Correctly, the document has ended and there are no sheets in the ADF.
I'm not sure what's due to this. I want confirmation.
1) How to rewrite scanimage so that the response is needed for the second part of the command?
or
2) What to add or rewrite so that the second part would run even if there are errors?

phpSane from here https://github.com/gawindx/phpSane

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-07-28
@UPSA

&&-> ;
&& - the next command will be executed if the first one is successful - returned 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question