I wanted to do an automatic sync of a directory in my hard drive with 1 directory in my mp3 player (MSU Enabled) To launch an action on detecting it
I used the udev system by creating a rule under /etc/udev/rules.d/10-local.rules
SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL ", SYMLINK+="DAP", MODE="0666"
SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL ", ACTION=="add", RUN+="/usr/local/bin/music-sync %k"
The first line creates a symbolic link called DAP under /dev/ \ The second line runs a script I wrote to sync (and mount if required) the device