Answer the question
In order to leave comments, you need to log in
How to avoid wastage of inotifywait and/or implement BASH multi-threaded atomic processing?
The crux of the matter is this. There is a remote server on which files appear in a certain folder in the course of work. There is a remote server that monitors the appearance of these files, in case of occurrence it takes the data, processes it and gives it back. I draw your attention to the fact that the data folder is different than the files being taken. Those. I just pass only the name of the data in this way.
#!/bin/bash
ssh [email protected] inotifywait -e create /any_path1/ --format "%f" -q -m| while read file; do
scp [email protected]:/any_path2/$file* ./
....
#некоторая обработка длительностью 5-20 секунд
...
scp $file.res [email protected]:/any_path2/$/result/
done
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question