[Dirvish] Re: Hard Drive Died, and I was shocked to discover...

Brian Martin Brian at MartinConsulting.com
Mon Feb 13 13:41:22 EST 2006


> One of the things I do with my post-dirvish script is a "df" of the
> target drive, which I run through a little perl script then store in
> a log file in /var/log.  I look at the log file fairly frequently,
> to make sure I am not getting too close to filling a backup disk.
> Of course, I also notice if the disk is not slowly filling up.  

In my script to run dirvish, I follow it up with a df, but I also search the
new tree for total items and for items that only have one hard link.  Those
are latter ones are new items.  For each, I count and number of them and
total up the sizes.  If counts or size totals falls out of a reasonable
range, that's an indication of possible failure.

Here's a sample bit of output:

svr2 /usr/local/dirvish/svr2/02-11-2006-Sat: Total Items: 582521 (60623.8M),
New Items: 37373 (807.1M)

I find the new items using the Perl File::Find module, but non-Perl folks
could get something similar with the following command line command: 

	find /usr/local/dirvish/mysystem/latest/tree -links -1 ls

... changing the initial directory path as appropriate, of course.  I'm not
sure if there needs to be an exclusion in there for symbolic links -- I
think they always have a count of 1.

          -Brian Martin




More information about the Dirvish mailing list