LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-16-2007, 11:19 AM   #1
strangeslack
LQ Newbie
 
Registered: Feb 2005
Distribution: Slackware
Posts: 17

Rep: Reputation: 0
Auto run a script when connecting a USB device


How do I go about running a script when I connect a USB device to the machine?
the device in this case is an External HD, that I'd like to dump various stuff onto each time it's plugged in.
 
Old 11-16-2007, 12:40 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 64
You can use udev. Add a rule that matches the hardware based on some distinguishable criteria. Then, add a target script. E.g.,
Code:
KERNEL=="sd?1", SYSFS{serial}=="123456789", RUN+="dumper.sh"
(dumper.sh is located in /lib/udev)
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-login script for connecting to remote m/n by using telnet/ftp/ssh Uday123 Programming 5 10-12-2011 11:31 AM
auto run script muleypr Linux - General 16 10-30-2006 06:14 AM
Getting firewall script to auto-run at startup lrt2003 Linux - Newbie 2 04-25-2004 02:28 AM
auto update script not connecting kabads Linux - General 0 01-23-2003 03:44 AM
Auto Run A Cgi Script f117bomb Linux - General 1 11-25-2001 01:18 AM


All times are GMT -5. The time now is 09:28 AM.

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
Open Source Consulting | Domain Registration