Runnig a command automatically when (un)mounting



Hello.

I am looking for a way to automatically run a command (preferably chosen
by a non-root user) right after mounting or right before unmounting a
device. Specifically, I want to run a simple script synchronizing some
data on an USB flash drive with its hard disk backup every time the USB
drive is plugged in or out.

Does e.g. HAL or gnome-volume-manager/gnome-mount (I use GNOME) enable
such a thing?

Regards,
--
Krzysztof Lubanski
.



Relevant Pages

  • Re: error while doing installworld
    ... > command are you using to build world? ... The small dive unable to hold a ports & src is able to hold its own /usr/obj ... does so when mounting it over nfs i have the option to do the buildworld on ... My Big machine is somewhat setup in a similar way running 4.10-STABLE i ...
    (freebsd-current)
  • Re: cant mount drive
    ... > i've tried unmounting it but I get the same error thats it in use by ... Its like something is mounting it daring boot or ... the cd drive and try out the burn or mount command? ... Make sure you post the exact messages that you get when you try things ...
    (Fedora)
  • Problems with files greater than 2 GB on Suse 10 Retail
    ... I am mounting a Netware 6.5 volume using ncpmount and then using the ... command line cp command to copy very large imaging files onto a ... I am using the terminal window, ...
    (alt.os.linux.suse)
  • Re: /proc/NNNNN accuracy
    ... the PID directories in the /proc filesystem ... unmounting /proc or by mounting stuff on top of it at will. ... > I realize a running program could change its command line etc. ... the pid and uid will be correct the moment you read it. ...
    (comp.os.linux.security)
  • Re: mysql connection through ssl tunnel
    ... I solved this problem by figuring out how to execute the command inside the rc script as a non-root user. ... echo "$$" ...
    (freebsd-questions)