Jump to content

Random question on mounting removable devices


flarefox
 Share

Recommended Posts

I'm still fairly new to much of this, but I am making a digital media box and I want to allow people to put a removable device such as a flash card or digital camera or hard drive on the system and have it copy over images/video files when they insert them. I can make the script no problem, but...how do I get it to run when a removable device is inserted? Is there a simple way to do this?

 

~Dee

Link to comment
Share on other sites

This can probably be done through the built-in hotplugging capabilities of the Linux kernel.

 

Here is a link to check out:

 

http://linux-hotplug.sourceforge.net

 

Here is a writeup on something that sounds similar to what you want to do:

 

http://jphoto.sourceforge.net/?selected=sync

 

Also, look around in /etc/hotplug

 

Check the hotplug manual page (man hotplug)

 

You might try google for keywords like linux, hotplug, usb, script, etc.

 

To see hotplugging in action, plug in a USB pen drive and then execute the command dmesg from a terminal. You'll see the device messages that get generated from the hotplug event. It looks like much of this is done through the various hotplug scripts, so you have to somehow find out how to get your scripts working within that structure.

Edited by jboy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...