Using Dirvish
After installing it (depending on your distribution this could be as easy as "sudo apt-get install dirvish"), you need to configure banks.
...be SU
It might be good if you are a superuser to continue. You can also run dirvish without being a superuser, but its more complex.
sudo su
Setup your first bank
Backups reside in "banks". You can put multiple backups into one "bank". A bank is simply a folder.
create one:
mkdir /backups
Setup your first vault
A "vault" is a location inside a bank that contains a backup. You can put multiple backup jobs into the same bank.
Creating a vault is done by creating a subfolder with a special file in it. Given I want to backup "myserver":
/backups/myserver/dirvish/default.conf
Inside this file, you need to specify what dirvish should back up. If you want to make a backup of the local server (conveniently named "thishost", this is the result of the comman hostname), it would look like this:
client: thishost
tree: /
xdev: true
index: gzip
image-default: %Y%m%d
exclude:
var/cache/apt/archives
var/cache/man
tmp
var/tmp
Initialize the vault
Before you go on, you must tell dirvish to initialize the vault.
go to your vault, and init it:
cd /backups dirvish --vault myserver --init
Configure Dirvish to know your bank
Edit the master configuration file in /etc/dirvish.conf or /etc/dirvish/master.conf.
Write the location of your bank there:
bank: /backups
Actually, you should write a few more lines into master.conf. This should get you started, read the manpage of dirvish.conf for more:
bank:
/backups/
expire-default: +60 days
expire-rule:
wd { sun } +60 days
wd { 2-7 } +4 days
Runall:
myserver
Run it automatically with a cronjob
Backups are based when you run then automatically. For the beginning you can use something simple like this:
0 0 * * * root /usr/local/bin/dirvish-expire --quiet ; /usr/local/bin/dirvish-runall --quiet
You should always run dirvish-expire first. It is responsible for removing snapshots which have exceeded your retention policy time period, freeing up space you may need for the next run of dirvish-runall. Ensure you allow enough time for dirvish-expire to finish.
More
There is a simple and good guide here: http://www.dirvish.org/debian.howto.html There is a bigger guide here: http://wiki.edseek.com/howto:dirvish . Some of the text from over there is reused here.
Ready? Then head on to the DirvishTips to learn more.
