I'm quite desperate after several tryouts of making a quite simple backup program. After 6 hours of following and trying all posts on that topic, I don't know any solution. I just want a java script to start as soon as I plug in a USB drive.
sudoedit /etc/udev/rules.d/90-local.rules
In my local rules I basically, just want to run my SUPERJAVA shell I tried already all kind of ATTRS / ATTR combinations. My last state is:
BUS=="usb", KERNEL=="sd*", ATTRS{serial}=="4C530009320619116345", ACTION=="add", SYMLINK+="kram", RUN+="/home/d/Desktop/DirSyncPro-1.51-Linux/SUPERJAVA.sh"
The shell, just starts a simple Sync program, but works in itself if I start it regularly in the terminal.
#!/bin/bash java -jar dirsyncpro.jar
However, in the log file, it doesn't make any effort to run the program, if I plug in the USB.
tail -f /var/log/syslog
Just to get back the steps: 1. lsusb
, which gives me: entBus 002 Device 012: ID 0781:5572 SanDisk Corp.
2. udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/012)
, which gives me: looking at device '/devices/pci0000:00/0000:00:1d.7/usb2/2-2':
KERNEL=="2-2"
SUBSYSTEM=="usb"
...ATTR{idVendor}=="0781"
...ATTR{serial}=="4C530009320619116345"
...ATTR{idProduct}=="5572"
...ATTR{product}=="Cruzer Switch"
...ATTRS{idVendor}=="1d6b"
...ATTRS{idProduct}=="0002"
...ATTRS{product}=="EHCI Host Controller"
...
Does anyone has another idea what I could try? Is udev not compatible anymore with Ubuntu 14.04?
udev
rules are perfectly compatible with 14.04. What you are trying to achieve is fairly standard. Where does your usb volume mount (withcat /etc/mtab
andmore /proc/mounts
) ? In what way is your usb medium involved in your backup process ? I.e. where does it come in when you run/home/d/Desktop/DirSyncPro-1.51-Linux/SUPERJAVA.sh
? Please edit your question so we can help. Please respond with @Cbhihe.cat /etc/mtab; more /proc/mounts
?