I have common script so that when users plug in their USB drive it copies the files from a specific folder to the array.
The usb gets automounted, backed up and then unmounted.
I have set up a usb hub so that multiple usb drives can be plugged in at once.
The script works fine however the issue i am having is when a second usb gets plugged in the common script gets executed again on the first usb which causes it to backup twice.
I though the common script gets called once for the device that gets plugged in and not on all plugged in devices? Is this intended? Is there a workaround so it only runs once on the drive?
There are many of these backup drives so i would like to do it from a common script if possible but cant have it run multiple times on each plugin.
Just to add for clarity i start my script with the following.
case $ACTION in
'ADD' )
if [ -d $MOUNTPOINT ]
then