Re: Runnig a command automatically when (un)mounting



On Sat, 06 Oct 2007 18:55:36 +0000, Krzysztof Lubanski wrote:

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,

KDE at least has a context menu 'safely remove this device', which I
*think* calls umount. You might write a macro to sync the contents of
whatever you're unplugging, _then_ umount. If you want to get really
adventurous, discover where that context menu points, and insert lines to
examine the device being removed and sync before unmounting if-and-only-if
it's the device you want to sync up.
.



Relevant Pages