following is my script for space detect
here the dir is: "/slowfs/hspice01/liguoj/performance/MT4/Rundir/Tue/RHEL4", and will not change during runtime.
detect_disk() will invoke many times, the problem is during the first several times it run correct, but then failed.
sub detect_disk
{
my ($flag, $dir) = @_;
my $available_space = `df $dir`;
my @array = split(/\s+/, $available_space);
$available_space = $array[10];
if ($flag eq 'entry' and $available_space < 6000000)
{
print ("NOTICE: The left space of $dir is $available_space (KB
+), please make sure enough space is available for the regresssion.\n\
+n");
}
elsif ($flag eq 'routine' and ($available_space < 1000000))
{
print ("NOTICE: The left space of $dir is $available_space (KB
+), regression will waiting!\n");
sleep 60;
while ($available_space < 1000000)
{
# send_mail($mail_list, $report_title, $report_file);
$available_space = `df $dir`;
@array = split(/\s+/, $available_space);
$available_space = $array[10];
sleep 60;
}
}
}
|