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; } } }