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