![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [REQ] Automatic script kill process | onisoc | Shell Programming and Scripting | 3 | 05-25-2009 06:17 AM |
| Script for automatic deletion of old files | vivek_scv | Shell Programming and Scripting | 4 | 09-09-2007 01:57 AM |
| Automatic FTP Script from windows to unix machine | bmkreddy | Shell Programming and Scripting | 3 | 05-10-2007 11:30 AM |
| Automatic download of csv file using a shell script | figaro | Shell Programming and Scripting | 1 | 01-13-2007 08:53 PM |
| Automatic login script | dayanand | Shell Programming and Scripting | 3 | 01-08-2006 07:46 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Automatic script
Hi,
is it possible to automatically run a script (bash) when an event occurs? I mean, let's say that I (or one of my users) plug in a flash memory (USB) ... is it possible to run a script every time I do this action (let's say to log user, date and other infos on a file)? Thanks! Bye... |
|
||||
|
It depends on your USB subsystem. Many of them are eminently scriptable and work exactly as you describe. Look at hotplug and hal for a start if you are on Linux. If you examine your system log when you insert a removable storage device, you should get some hints about where to look, as well.
("User" is not well defined in this context, by the by; the insertion of a USB stick is not necessarily performed by a user who exists on the system, much less one who is logged in; of course, if only one user is logged in, you can make some conjectures, but that's heuristics.) |
|
|||||
|
Yes, but some mechanism has to do your copy jobs and I doubt, that the same part that realizes that there is a new usb device can do any actions like copy stuff for you etc. on it's own by passing that as parameter or in some config file.
But I have no clue about Mac OS X either. |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|