But: /media/ appears only AFTER autocopy.sh has been executed.
So, I suppose I need 2 script:
autocopy.sh:
/bin/bash /home/osmc/autocopy2.sh &
autocopy2.sh:
<the real script, for loop, etc…>
This way I can put autocopy2 in background, letting autocopy ends immediately and so does usb folder inside /media
But I’m not sure this is the right way…
EDIT: obviously, it doesn’t work: autocopy2.sh doesn’t go to background… so autocopy is waiting to autocopy2 to finish… but usb folder in /media doesn’t appear till autocopy ends
So the real script (autocopy2) doesn’t found usb folder to copy.