On Wednesday 05 March 2008 10:16:05 pm Colin Ingram wrote:
> This may be a silly question...but are there tools available to split a
> vault.  For example I am backing up a filesystem which looks like this
>
> bkroot--
>
>            ----dir1
>
>            ----dir2
>
> and backup system is
>
> bank1 - vault1(bkroot)
>
> and I want to change this setup to
>
> bank1 - vault1(bkroot/dir1)
>           - vault2(bkroot/dir2)
>
> or
>
> bank1 - vault1(bkroot/dir1)
> bank2 - vault2(bkroot/dir2)
>
> preserving hardlinks and such from previous backups.
>
>
> Thanks for you help


A noisy (verbose) rsync like below can do the trick.

rsync -avPiH /old/vault/location /new/vault/location --include=/*/tree/dir1 
--exclude=/*/tree/* --exclude=/*/log --exclude=/*/summary  --stats

You will need to change the following:

"/old/vault/location" "/new/vault.location" "--include=/*/tree/dir1"

You can, of course, quiet it down by removing the vPi and --stats

This will leave dir1 as the only directory in each image in your new vault.  
If you don't want this, you'll need to move it down manually with something 
like this (run from the offending vault):

for X in `ls -1` ; do mv -v $X/tree/dir1/* $X/tree ; rm -rvf $X/tree/grub ; 
done

I do not know what this will do to expire, as I do not know which files 
dirvish-expire reads to expire vaults.  I do know that log and summary files 
will not be copied.  I excluded them because they are no longer accurate to 
the image.  You can (and may need to, can someone comment?) copy them by 
simply removing their excludes in the rsync command.

I did somewhat test this, but make sure you test and verify it yourself first.  
I did verify that it maintained the hard links through both processes on a 
ramdrive.

hostname dirvish-test # du -hsc *
484K    2008-02-01
0       2008-02-10
4.0K    2008-02-17
0       2008-02-24
0       2008-02-28
0       2008-02-29
0       2008-03-01
0       2008-03-02
4.0K    2008-03-03
476K    2008-03-04
0       2008-03-05
0       2008-03-06
56K     dirvish
1.0M    total

hostname dirvish-test # du -hslc *
484K    2008-02-01
484K    2008-02-10
484K    2008-02-17
484K    2008-02-24
484K    2008-02-28
484K    2008-02-29
484K    2008-03-01
484K    2008-03-02
484K    2008-03-03
480K    2008-03-04
480K    2008-03-05
480K    2008-03-06
56K     dirvish
5.8M    total
_______________________________________________
Dirvish mailing list
[email protected]
http://www.dirvish.org/mailman/listinfo/dirvish

Reply via email to