Dirvish Vault Creation
The 28 July 2005 i sent a question to the Dirvish mailing list, and /Keith Lofstrom/ said to me...
On Thu, Jul 28, 2005 at 11:11:14AM +0100, /Antonio Cardoso Martins/ wrote:
>> Would it be possible to automatically append --init option to dirvish if there is no other branch in the vault?
This is a good question - and one of those "jw schultz probably had reasons for not doing this, but we may never know" questions.
My guess is that doing an --init accidentally over the top of an already functional vault might destroy it. Not Good. This is not something I want a program to automatically decide for me; one small configuration problem or program bug, and bye-bye backups.
Also, the --init takes a lot longer than normal operation. The temptation would be to set dirvish up for regular operation, with a call to dirvish-runall in cron, then realize after it automatically starts that your network is tied up for a day or two while all the first images are built.
It would not be hard to add a --init option to dirvish-runall, or to add automatic --init to dirvish, but we need to address those concerns first.
At a higher level, we should probably design an overall configuration program that helps a new user make proper decisions during setup. Doing tests, estimating initialization time, estimating disk usage, suggesting partitions and LVM and file system types, etc. should be part of the configuration step.
The problem is that most of us familiar enough with dirvish to write this code have already set up our systems, and have no need for the initialization code. Some itches go away before you can scratch them. However, if we bring in enough new users, then one of them might be motivated to write the configuration program and pester us to help make it work. Perhaps that new user is you...
Keith Lofstrom - keithl AT keithl DOT com
Dirvish Vault Creation and Configuration Script
As the answer to the challenge from Keith, i am posting version 0.0 of the dirvish-create-vault script, written in /bash/ (sorry for not being /perl/), with some features to help build vaults and deploy dirvish configuration throughout backup clients.
What dirvish-create-vault can try to do for you ...
For the client:
- Test network connectivity
- Copy public key file into client, if you use ssh
- Extract automatically client Operating System info (if ssh supported)
- Check rsync version on client (if ssh supported)
- Guess what hard disks the client has (if OS=Linux)
- Create /dev/hdmain symbolic link to allow sfdisk command in pre/post backup scripts
For the Dirvish backup server:
- Create Dirvish master configuration sample file
- Create Vaults
- Create Banks if the vault is in a new bank, editing master.conf
- Ask for backup tree path
- Rsync daemon support, with setting for /password-file/ directive
- Ask if you want to cross mount points
- Ask for the index file format
- Create a basic and simple /default.conf/ vault configuration file, based on the information gathered
- Allows the user to mannualy edit the vault configuration file
- Suggest to run the dirvish --vault <vault> --init command
- Suggest to put the dirvish backup command in Runall directive or make a cron job for the vault.
What this script '''cannot''' do for you ...
One big thing that the script does not execute is the --init option to initialize the vault
Everything that Keith said... - Help user make proper decisions during setup
- Doing tests
- Estimating initialization time
- Estimating disk usage
- Suggesting partitions and LVM and file system types
- Etc.
How to use dirvish-create-vault
Adjust the following variable at the top of the script:
- DIRVISH_BCK_DIR=/backup/dirvish
to reflect your preferred dirvish backup directory.
Call the script, answering to all the questions. There are many. You should know in advance the data you want to backup on the client, the protocol to use, and the rest is simple.
You can optionally provide from the command line, the backup client hostname and user:
- dirvish-create-vault [[username@]client_computer]
Client_computer is the hostname or ip address of the dirvish vault client.
[username@] is the user used for rsync or ssh authentication against the client.Example : dirvish-create-vault root@example.sampcomp.net
I think this could be the base for many improvements that we could make to contribute to Dirvish backup solution.
Code (version 0.0 from 2005 August 09) [http://wiki.dirvish.org/plugin/attachments/CreateVaultScript/dirvish-create-vault dirvish-create-vault] here
I am waiting for your suggestions, improvements, comments, ... anything.
Antonio Cardoso Martins (acmartins@hal.min-saude.pt)
