So I'm executing pisg with a HUGE logfile, but most of the time it disconnects the eggdrop with ping timeout because it takes like 2 and a half minutes for pisg to analyse it.
Now, is there a way to execute pisg without being disconnected?
Thanks in advance. (if you want, ill post the tcl script)
and this wont cause a ping timeout? because if I get this right, i open pisg, and read it until its closed, but then, it takes 3 minutes to close because it takes 3 minutes for pisg to analyse the log.
If i'm wrong please tell me so, thanks for the reply btw!
The trick here is, output is read as it comes available, being triggered by an event-handler, while "exec" will block until the execution is complete (thus causing your bot becoming unresponsive for several minutes and ping timeout). The "open" command will return instantly, providing a file-handle which you can pretty much use just like any other file, except that you're writing to the program's stdin, and reading from it's stdout.
The "fileevent" command is what sets up the event-handler to track the opened pipe for a readable-condition, at which readpipe will be called to look for an eof-condition, and try to read one line.
I'd make a little shell script to run pisg, and then run that shell script from cron. I posted an example shell script to do just that, in the shell help forum (it also uploads the stats page to an ftp site if you need that as well.)