LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   executing command on usb disk mount (https://www.linuxquestions.org/questions/linux-desktop-74/executing-command-on-usb-disk-mount-688827/)

belda 12-06-2008 06:58 PM

executing command on usb disk mount
 
Hi there,
Im creating a simple terminal based on ubuntu linux, which will be used to copy some data on users flash disk, but I do not want the users to need to do anything, so basicaly what I need is
  • user inserts flash disk
  • command is executed
  • data is beeing copied to the flash disk while showing progress
  • disk is unmounted
  • user is notified

I got to the point of using zenity to the the gui parts, but what i still do not get, is how to execute the script, when the disk is mounted.

Im using Ubuntu 8.04.

konqi 12-07-2008 01:52 AM

So you want to mount your flashdisk and automaticly execute the command on the flash disk?

You could make a shell script wich does the job for you. So when you run the script it mounts the disk and then executes the script.

David the H. 12-07-2008 03:09 AM

I think your best option would be Ivman. It's a daemon that monitors hal, and will let you run commands whenever a drive is inserted or removed or when the mount status changes. The config files provide clear examples on how set it up.


All times are GMT -5. The time now is 02:34 AM.