[Dirvish] Multiple banks and multiple dirvish instances

Paul Slootman paul at debian.org
Wed Feb 24 16:15:56 UTC 2010

On Wed 24 Feb 2010, hanj wrote:
> What I need to do is create a separate backup that backs up once per
> month and expires after one year. So, I still want my 5 week backups on
> various servers. Nothing changes there. But I'm trying to create a
> yearly bank where I'm backing up the same same servers once a month and
> expiring after one year. So those vaults will only have 12 images for
> each server.

So, a separate bank for those monthly images?

> I was thinking of adding something to /etc/cron.monthly, but I'm having
> trouble telling dirvish to use a different master.conf where bank and
> vault options are. It seems to always reference
> my /etc/dirvish.master.conf even if I supply a different config.

The key here is that dirvish _always_ reads the master.conf first,
even if you specify --config.

You could move the bank specifications to a daily config file, and
always specify the daily config file via --config, and using the monthly
config file when making the monthly image.

Personally I would instead create a script to copy the latest daily
image to the monthly bank _after_ creating the daily image. That way the
client isn't being accessed twice for the same data. Of course if you're
backing up the local system, that doesn't matter much; if you're going
over the network things may be different.

Something like:


set -e

IMAGES='foo bar'

for i in $IMAGES; do
    cd $DAILY/$i
    newest=`ls -t | head -n 1`
    if [ -d $newest ]; then
        previous=`ls -t $MONTHLY/$i | head -n 1`
        if [ -d $MONTHLY/$i/$previous ]; then
            rsync -aH --link-dest=$MONTHLY/$i/$previous/ $newest $MONTHLY/$i/

Totally untested :-)


More information about the Dirvish mailing list