Refining the script for automatic printing
From time to time, pdf files are thrown into a specific sftp folder. Size from 10 kb to 25 mb. The number of pages in files from 1 to 200.
There is a local script that monitors this folder. As soon as a file appears in the folder, the script waits for the file to be fully downloaded, then throws it to the seal through CUPs and then transfers the file to the folder where the already printed files are stored.
The script is here - https://www.dropbox.com/s/we8iengka3a7dhv/Druckserver.zip?dl=0
The script itself is a spooler, its config spooler.conf and a run file for runit.
Everything in general works except for one moment. The file is transferred to the folder of the already printed files as soon as it goes to print in the CUPs. In this regard, we are faced with a situation where the file is "pulled out" of the folder until the moment it was completely in the CUPs. As a result, we get not fully printed documents. This is rare, but it happens.
We tried to test the delay in transferring the file to the worked-out folder. We have ensured that all documents are printed in its entirety, but at the same time we have received cases of takes, when the file is printed 2 times, which is not surprising, because the monitoring of the folder manages to "catch" the file twice before it is transferred.
We need to finish or remake the script so that it works like a clock. The server with the printer is remote and the file is not fully printed or the printing of takes results in a piece of additional work.
09.03.2021 13:26