February 2006
Intermediate to advanced
304 pages
6h 16m
English
I ran out of disk space today. I was working on a program that produced a number of huge core dumps and filled up my disk. Of course I didn't notice it until I started to do a compile and found that my object files were getting truncated. It would have been nice to learn of the problem sooner. As it turned out, because the build broke, I was forced to clean out the core files and restart the build from scratch.
This script tells everyone when disk space is low.
1 #!/usr/bin/perl 2 use strict; 3 use warnings; 4 5 use Filesys::DiskSpace; 6 7 my $space_limit = 5; # Less than 5%, scream 8 9 if ($#ARGV == -1) { 10 print "Usage is $0 <fs> [<fs>....]\n"; 11 exit (8); 12 } 13 14 # Loop through each directory in the 15 ...Read now
Unlock full access