0

How to make inotifywait runs command in queue?

According to this script that moves file automatically right after it is created

cd "a specific folder"
inotifywait -me close_write --format %f . | while read file
do  
    rclone move "$file" …
done

In case that multiple files are created at the same time or gradually how to make them(the transfer) run in queue?

Ljm Dullaart
  • 4,273
  • 2
  • 14
  • 31

1 Answers1

0

You need to know the specific name of the file that you are expecting to be "dropped" in the folder, if you want to control the sequence of actions. Otherwise (for monitor on directory), you need to accept that they might be out of order and deal with the names as they "pop up" for a chosen "end action".

Eric Marceau
  • 1,601
  • 1
  • 8
  • 11