udev rules 2 times exec script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi, I try configure the rule in udev for when I connect specific usb
device, launch script backup.

I have this rule:

/etc/udev/rules.d/10.autobackup.rules

SUBSYSTEM=="block", ACTION=="add", ATTRS{idVendor}=="058f",
ATTRS{idProduct}=="6387", SYMLINK+="external%n",
RUN+="/usr/local/bin/autobackup.sh"

This works well, buth exec 2 times the script...

Jun 12 13:53:09 archlaptop autobackup.sh: BEGIN SCRIPT
Jun 12 13:53:13 archlaptop autobackup.sh: BEGIN SCRIPT

I googled and I see this:

The issue was resolved by adding ENV{DEVTYPE}=="usb_device" in a rule.

If add ENV{DEVTYPE}=="usb_device" and change the
SUBSYSTEM=="usb_device" , when plug usb, udev does nothing ...

I don't understand why

udevadm info -a -p $(udevadm info -q path -n /dev/sda1)

https://pastebin.com/Zcz769BQ



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux