[Dirvish] Inotify triggered backup

Richard Geoffrion dirvish at rain4us.net
Fri Feb 8 00:39:25 UTC 2008

Red Mop wrote:
> <snipped the old post>
> Bottom posted just for you. ;)
Awww... aren't you the best!!  HAHAHA :)
> Ok, now what do I need to put in the config? Do I even need one? I 
> think I do as sometimes my laptop will need to be backed up remotely, 
> and thus, I will need to change the ip/hostname in the settings. If 
> someone knows a way around this, then I can actually finish this project.
You will need the ip or hostname of the computer.  I would imagine that 
you'll want to 'sed' the vault's default config to update the hostname.
> I'm running gentoo on all computers,
> I have multiple computers in the same bank, though I am considering 
> changing that, and multiple vaults per computer.
A bank is a collection of vaults.
A vault is a collection of images

I don't understand why you would want multiple vaults per computer 
unless it is for retention time...but that's your design and you know 
your design.
> So this should be all I need to do then?
> COMPUTERNAME=(triggering computer)
> for VAULTNAME in `ls -1 $COMPUTERNAME-*` ; do
You'll have to be IN THE BANK that contains the vaults for your `ls -l 
$COMPUTERNAME-*` to work.
FYI:  $( )  has replaced the backticks. 
  for VAULTNAME in $(ls -1 $COMPUTERNAME-*)   is now the better way to 
do things (in bash anyway)

FYI #2:   I don't think you need to do the extra work with 'ls'

for VAULTNAME in /path/to/bankdirectory/$COMPUTERNAME-*  ; do
 dirvish-expire $VAULTNAME
 dirvish --vault $VAULTNAME
...works quite nicely.

 > though I will be adding this to windows soon enough.

Um...yah... windows.   I'm working on that even as we speak.  I'm down 
to a single text file that the network admin manages that contains one 
line per client to backup

...et al....

The dirvish-smbworkstationbackup script will
a) mount the workstation banks
b) extracts the target workstations and the target shares into arrays
c) processes each workstation target to ensure that
    1)a vault currently exists
        a)create one if needed
    2)a mountpoint for the workstation's shares are created if needed
    3)the workstation shares are mounted
    4)dirvish is run on the workstation
d)errors for all the processes are saved to be processed to by a script 
that builds a backup status web page

I should post it to the wiki.  I'm sure it could be cleaned up..and made 
more 'general'...but at the least it might work for reference.


More information about the Dirvish mailing list