Hello to all,
I've a strage problem here:
a perl script that parses the output of sar -q 300 0 (one line of performace data each 5 min. infinately) works fine from the CLI. It processes one line output every 5 minutes.
If i disconnect it from the terminal (executing it with cron, nohup startporc etc...) no output is processed until sar has completed (using sar -q 1 20).
then all 20 llines output are processed at the same time.
Code
Quote:
open (SAR,"/usr/bin/sar -q 1 4&|") or die "Cant open sar" ;
while (<SAR>){
chomp;
# write the output into a rrd database
}
close (SAR);
the script is supposed to run as "demon" in the backdround to ubdate
performance reports every 5 minutes, so i need to process the output just in time.
As far as i foun out it is not a Perl problem rather than the way linux handels pipes on processes not running on a terminal.
any ideas ?