Jump to content

TonyF

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by TonyF

  1. 1 hour ago, dlandon said:

     

    What do you mean by a "common script"?

     

    Here?

    59c8d59aee93d_UDSettings.png.be6f38bb425afb531779aadb5a3c9bb8.png

     

    This script is executed for all drives plugged in.

     

    Each drive has its own script here:

    59c8d6dd0ecfb_DriveScript.png.fed7082812c88bd49c6806472ba4c925.png

     

    This is the script that runs once for each drive.

     

    Thats the one i was using. I wanted to avoid assigning a script to every individual drive (Theres quite a few usb drives and i dont have them all at once to preset).

     

    I guess if thats the case i can maintain a flat file database to determine what was just plugged in and run the routine only on that one.

  2. 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
    

     

×
×
  • Create New...