[Dirvish] Exclude backup from dirvish-expire

Keith Lofstrom keithl at kl-ic.com
Mon Oct 16 08:33:58 PDT 2006

On Mon, Oct 16, 2006 at 08:51:37AM -0600, hanj wrote:
> On Mon, 16 Oct 2006 15:59:02 +0200
> Leo Baltus <Leo.Baltus at tech.omroep.nl> wrote:
> > We normally move these vaults to a location outside of dirvish's scope
> > 
> > i.e. with vault1 in /bank1/dirvish/vault1 we create a directory
> > /bank1/dirvish.attic on the same filesystem as where vault1 is on.
> > Then if we want dirvish to stay away from these image we do:
> > 
> >         mv /bank1/dirvish/vault1 /bank1/dirvish.attic/vault1
> > 
> > If perfomed on the same filesystem this is an atomic operation which takes 
> > only a split second.
> > 
> > HTH
> > 
> Hello Leo
> That is what I'd like to do, but unfortunately, the drive with the space is all allocated to the dirvish bank, so I can't move it out of here due to space limitations.
> For example our dirvish bank is /backups with is a 250GB SCSI drive, and all of the images are within /backups/*.

While it is best if you use a directory structure like "/backup/dirvishbank1"
"/backup/dirvishbank2" for your dirvish banks, you no doubt have a lot of
history and summary files and configuration treating the partition as a
bank, so changing would be difficult.  

However, there is a trick.  When dirvish is looking for vaults to expire,
it is looking for files named "summary" within the bank.  Dirvish stops
looking at directories named "tree" or any subdirectories thereof.  So one
nasty hack is to build a directory named "/backup/dirvish.attic/tree/"
and move the vaults you want to leave untouched into there.  Ugly but
quick.  Possibly fragile, if dirvish-expire changes, but it probably
will work for now.  I don't run dirvish-expire myself, so you may want
to test this in a sandbox backup directory and tell us what you discover.

The relevant code in dirvish-expire is:

	sub findop
        	if ($_ eq 'tree')
                	$File::Find::prune = 1;
                	return 0;

This tells the Perl "find" function to stop exploring directories
named 'tree'.  A little kludgy, but fast.

In the longer term, though, it is better if you don't make partitions
into banks, and instead make directories in those partitions into
banks instead.  You should consider this the next time you create a 
new backup disk.


Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs

More information about the Dirvish mailing list