LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2008, 08:56 AM   #1
actmnophn
Member
 
Registered: Mar 2008
Posts: 52

Rep: Reputation: 15
Run script to copy usb drive when inserted


Is there a way to run a script that copies the files from my usb stick automatically when they are inserted? Am I able to use different scripts for different drives/types based on serialnum or deviceid or label etc...? I am running slax on an old laptop.
 
Old 11-19-2008, 09:00 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,937

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by actmnophn View Post
Is there a way to run a script that copies the files from my usb stick automatically when they are inserted? Am I able to use different scripts for different drives/types based on serialnum or deviceid or label etc...? I am running slax on an old laptop.
Well, there may be a way to write a udev rule to handle that, but not sure about the different scripts for different drives. The only way I could think of doing that (without a bunch of editing/admin), is to put the script on the USB drive, and name it the same thing. Write one udev rule to run that script when you insert it.

That's the only thing I can think of.
 
  


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 automatically mount a usb drive / cd when inserted and place icon on desktop? mr.v. Slackware 4 03-07-2007 05:39 PM
Run script when USB drive is mounted highgeere Linux - Desktop 2 11-13-2006 09:44 AM
howto auto-launch a script when usb key inserted? adamrosspayne Linux - Newbie 3 09-22-2006 05:21 AM
Konqueror won't load on KDE after usb flash drive inserted Black_Knight Mandriva 6 03-26-2006 09:06 AM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 07:57 AM


All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration