
Hi all, I have installed inotify-tools, and now the watch sets up nicely, but the print and move are not working andrewg@linux-ltv0:~> ./photobooth-hp Setting up watches. Watches established. lpr: Error - unable to access "/home/andrewg/Pictures/Webcam/2016-06-15-223028.jpg.8QE9IY" - No such file or directory mv: cannot stat ‘/home/andrewg/Pictures/Webcam/2016-06-15-223028.jpg.8QE9IY’: No such file or directory I don't know where the suffix after the .jpg is coming from, is that what is stopping the progress? Here is the script #! /bin/bash inotifywait -m -e close_write ~/Pictures/Webcam --format "%w%f" | \ while read filename; do lpr -P Photosmart_C5200 "$filename"; mv "$filename" ~/Pictures/Webcam/printed; done The print spool name is correct. Once the party is over I will play with Darktable and tethered shooting and specify a new Directory to watch. In theory the flash on the Eos should fire and give an outstanding result. Many thanks Andrew Greig

On 15/06/16 22:43, Andrew Greig via luv-main wrote:
lpr: Error - unable to access "/home/andrewg/Pictures/Webcam/2016-06-15-223028.jpg.8QE9IY" - No such file or directory
I don't know where the suffix after the .jpg is coming from, is that what is stopping the progress?
Possibly whatever is creating the files is first creating a temporary, and then moving it to the actual name. If you simply run: inotifywait -e ~/Pictures/Webcam you will be able to observe what the sequence of events is. If the file is being moved after creation, you would wait on the 'moved_to' instead of the 'close_write' in the script. Glenn -- sks-keyservers.net 0x6d656d65

On 06/15/2016 11:14 PM, Glenn McIntosh via luv-main wrote:
On 15/06/16 22:43, Andrew Greig via luv-main wrote:
lpr: Error - unable to access "/home/andrewg/Pictures/Webcam/2016-06-15-223028.jpg.8QE9IY" - No such file or directory
I don't know where the suffix after the .jpg is coming from, is that what is stopping the progress? Possibly whatever is creating the files is first creating a temporary, and then moving it to the actual name.
If you simply run: inotifywait -e ~/Pictures/Webcam
you will be able to observe what the sequence of events is.
If the file is being moved after creation, you would wait on the 'moved_to' instead of the 'close_write' in the script.
Glenn
Hi Glenn, The script: #! /bin/bash inotifywait -m -e close_write ~/Pictures/Webcam --format "%w%f" | \ while read filename; do lpr -P HP "$filename"; mv "$filename" ~/Pictures/Webcam/printed; done I appreciate your help with this. I was not able to get: inotifywait -e ~/Pictures/Webcam to return any data to me. In the meantime I deleted my printer in CUPS and added it again with the name "HP" and I tested the lpr -P HP "$filename" bit to make sure it would work. I set the paper size i the printer to 6"x4" photo, yet it printed out 4 tiled images for the picure (1/4 each tile) is that what the format part of the script was meant to correct? 4 years ago this script worked "out of the box" Apart from an OS upgrade to OpenSuse 13.2 nothing else has changed Many thanks Andrew Greig

On 16/06/16 23:05, Andrew Greig via luv-main wrote:
I appreciate your help with this. I was not able to get: inotifywait -e ~/Pictures/Webcam to return any data to me.
Sorry, that was my typo, should have been inotifywait -m ~/Pictures/Webcam (the '-m' is to keep it running, by default it will report all events)
lpr -P HP "$filename" bit to make sure it would work. I set the paper size i the printer to 6"x4" photo, yet it printed out 4 tiled images for the picure (1/4 each tile) is that what the format part of the script was meant to correct?
The format part is just to make inotifywait report only the filename. I'm not sure why you are getting a tiled image, might be to do with the size of the image or with the paper size. You may need to add some options to the lpr command (eg '-o fit-to-page' to force the image to the page size, and/or '-o media=Custom.4x6in' to set the page size). Glenn -- sks-keyservers.net 0x6d656d65

On 06/16/2016 11:23 PM, Glenn McIntosh via luv-main wrote:
On 16/06/16 23:05, Andrew Greig via luv-main wrote:
I appreciate your help with this. I was not able to get: inotifywait -e ~/Pictures/Webcam to return any data to me. Sorry, that was my typo, should have been inotifywait -m ~/Pictures/Webcam
(the '-m' is to keep it running, by default it will report all events)
lpr -P HP "$filename" bit to make sure it would work. I set the paper size i the printer to 6"x4" photo, yet it printed out 4 tiled images for the picure (1/4 each tile) is that what the format part of the script was meant to correct? The format part is just to make inotifywait report only the filename.
I'm not sure why you are getting a tiled image, might be to do with the size of the image or with the paper size. You may need to add some options to the lpr command (eg '-o fit-to-page' to force the image to the page size, and/or '-o media=Custom.4x6in' to set the page size).
Glenn
Thanks Glenn, I will continue tomorrow night, Sat night I have to be ready. Fallback position is that I become photographer for the night. I did have a look at darktable but tethering my Eos 600D with built in flash drained the battery rapidly. Once I get everything working I could hook the camera up to a studio flash with a brolly and blast away, but it's too close to the event. Cheers Andrew
participants (2)
-
Andrew Greig
-
Glenn McIntosh