Tuesday, 8 January 2013

Quick start howto for divish on Debian

  1. Prep
    1. Here, there is one backup server and two client servers that need to be backed up
    2. Make sure root user on backup server can ssh to mybox01.mydomain.net and mybox02.mydomain.net without password
      1. Later, much later, see online for better, more secure ways
    3. install dirvish and rsync on server, rsync on clients
      1. apt-get install dirvish
      2. apt-get install rsync
  2. Clients
    1. The below are just example directories, use your own, the ones you want backed up
    2. mkdir -p /data/backups/
    3. mkdir -p /data/backups/etc
    4. mkdir -p /data/backups/var/log
    5. rsync -av /etc/ /data/backups/etc/
    6. rsync -av /opt/ /data/backups/opt/
    7. Make a cron job to do the rsyncs above nightly
  3. Server
    1. mkdir -p /backup/dirvish/mybox01/dirvish
    2. mkdir -p /backup/dirvish/mybox02/dirvish
    3. vi /backup/dirvish/mybox01/dirvish/default.conf
      1. get contents below
    4. vi /backup/dirvish/mybox02/dirvish/default.conf
      1. get contents below
    5. dirvish --vault mybox01 --init
    6. dirvish --vault mybox02 --init
  4. Verify
    1. Backed up files should now be under /backups/dirvish on backup server
      1. tree /backup/ -d -L 3
      2. find /backup/dirvish -ls | less
  5. Tell dirvish to do nightly pull
    1. vi  /etc/dirvish/master.conf.mybackup
      1. get contents below
  6. Tomorrow, verify the pull worked, and next week too
  7. Exclusion and expire options
    1. Research options one can add to master.conf.mybackup
Server files

/etc/dirvish/master.conf

bank:
    /backup/dirvish

Exclude:
    lost+found/


/etc/dirvish/master.conf.mybackup

Runall:
    mybox01
    mybox02

/backup/dirvish/mybox01/dirvish/default.conf

client: mybox01.mydomain.net
tree: /data/backups

xdev: true
index: gzip


/backup/dirvish/mybox02/dirvish/default.conf

client: mybox02.mydomain.net
tree: /data/backups

xdev: true
index: gzip



No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...