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;
}
}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.