[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Running programs on file creation



A bit of a strange question here, but does anyone know of a way to run a
program as soon as a file is created in a specific directory?

Basically I've got a system set up so that every minute the directory
/var/lock/connect is checked, and if there are any files in there then I get
connected to the internet, and if there aren't any files in there then I get
disconnected from the internet. This is done via a crontab entry, and works
fairly well. The problem is the 1 minute turn-around on
connection/disconnection attempts. I was just wondering if there's a way of
doing it automatically on the creation of these files?
--
Graham

An' Ye harm none,
do as Ye will.


___________________________________________________________________

Sheffield Linux User's Group - http://www.sheflug.co.uk . 
To unsubscribe from this list send mail to 
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.