I have a system running SliTaz and I need to automatically mount a device when it is plugged in, run a script, then dismount the device.
This is for automatic backup of a headless system.
I found a udev rule that works perfectly on a similar Fedora setup, but it does not seem to do anything on the SliTaz install...
Is there something I must change to make it work on SliTaz?
Here is my udev rule:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024", KERNEL=="sd[a-z]", NAME:="%k", SYMLINK:="backupdevice", OPTIONS="last_rule"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024", ACTION=="add", KERNEL=="sd[a-z]1", SYMLINK:="backuppartition", GROUP:="users", NAME:="%k"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024", ACTION=="add", KERNEL=="sd[a-z]1", RUN+="/bin/mount -t auto -o rw,noauto,async,dirsync,noexec,nodev,noatime /dev/%k /media/backup-drive"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024", ACTION=="add", KERNEL=="sd[a-z]1", RUN+="/usr/local/bin/usb_backup.sh" OPTIONS="last_rule"SUBSYSTEMS=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024", ACTION=="remove", KERNEL=="sd[a-z]1", RUN+="/bin/mount -l /media/backup-drive", OPTIONS="last_rule"