execute script after (auto)mounting external device

Tom H tomh0665 at gmail.com
Sat Dec 5 02:11:08 UTC 2009


>> I thought that you would be able to grep for your removable's uuid or
>> label and then run whatever script you wanted. The script would have
>> to be run manually though; not quite what I understand that you want.
>> The only other option that I can think of is to write a udev rule for
>> your device to run a script.

> We are getting closer to a solution (thanks for your patience so far!):
> Do you have a pointer on how to write a udev rule?

Possibly "SUBSYSTEM=="block", ATTR{address}=="uuid", RUN+="/path/to/script".

You can get the correct susbsystem and attr entries with udevadm info
/dev/<...>.

This is my last email tonight. My shift is ending in 2o minutes and I
have to focus on work before I leave.




More information about the ubuntu-users mailing list