EHLO!
This started like a "hey, give me 30 minutes" but here I am a day after. Basically what I want to do is to check "/var/log/messages" for 30 seconds and when someone plug-in a USB hard disk during that time, execute some commands.
So I am using Per function "File::Tail", and kinda works but I don't know how to run it for just 30 seconds, tail stays there until I manually exit( It works just as tail command). I been looking for solutions using fork but still no luck or experience on it. Part of the "tail" code is like this:
while ((defined($line=$file->read)) ) {
I appreciate any help or tip. If anyone has another solution using another, function or what ever, it's fine, I need the code for a "CGI".