Run script on thumb drive insertion?

Derek Broughton news at pointerstop.ca
Fri Jun 8 16:55:58 UTC 2007


Neil Cherry wrote:

> I'd like to run a script automatically when a thumb drive is
> inserted. Is there such a program? If not I think I can stat
> the mount point and on change run a script. I have the basic
> C structure from a biff program I wrote a long time ago.
> 
It's a while since I've done this but I'd look at "udev" and its "rules.d"
directory.  Create a rule that recognizes the device, and use the PROGRAM=
parameter to tell it to run a program.
-- 
derek





More information about the ubuntu-users mailing list