LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 12-06-2008, 06:58 PM   #1
belda
LQ Newbie
 
Registered: Dec 2006
Posts: 15

Rep: Reputation: 0
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.
 
Old 12-07-2008, 01:52 AM   #2
konqi
Member
 
Registered: Oct 2007
Distribution: Gentoo, Slackware
Posts: 160

Rep: Reputation: 16
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.
 
Old 12-07-2008, 03:09 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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.

Last edited by David the H.; 12-07-2008 at 03:12 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount an USB disk in redhat? karthikit Linux - Software 1 10-24-2007 06:34 AM
How to mount an USB disk in redhat? karthikit Linux - General 1 10-24-2007 06:09 AM
Trying to mount a USB Hard Disk guarriman Linux - Hardware 2 07-12-2007 03:33 AM
Mount USB disk with permissions EcceVery Debian 4 06-05-2005 12:18 PM
How do you mount a USB flash Disk?? chutsu Linux - Hardware 1 09-02-2004 06:00 PM


All times are GMT -5. The time now is 11:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration