backup files with rsnapshot

February 15, 2009
By randall

<div id=“dw”>

backup.cipar.net (192.168.1.13)

The domU that will act as the back up server will be the only one placed on the 2 terabyte disks in the RAID1 setup. Besides keeping a week of daily back ups of the data with rsnapshot from file.cipar.net and mail.cipar.net of this office and 1 of the remote offices we want to make a manual backup of each domU with lvmsnapshot to make sure we can easily have each server up and running in no time.

installation

newvserver --vsroot /BACKUP --hostname backup --domain cipar.net --ip 192.168.1.13/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0
# cd /usr/local/sbin
# ./set-context.sh backup
vserver backup start
vserver backup enter
locale-gen
# nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free
deb http://192.168.1.12:3142/www.backports.org/debian etch-backports main contrib non-free
# apt-get update
# apt-get install debian-backports-keyring
# apt-get update
# apt-get upgrade

rsnapshot

http://manpages.songshu.org/manpages/lenny/en/man1/rsnapshot.1.html

For more options and further reference this would be a good place to start http://www.debian-administration.org/articles/217

  • !!!MIND, this is a great script but, FOR SOME REASON IT USES tabs AND WILL NOT WORK WITH SPACES!!!!
# apt-get install rsnapshot
# nano /etc/rsnapshot.conf

comment out the interval's for the backup

interval        hourly  6
interval        daily   7
interval        weekly  4
interval        monthly 6

then we set the directories we want to backup
for the file server:

backup  root@192.168.1.8:/home/share/   local/shares/
backup  root@192.168.1.10:/var/www/avantfax/faxes/      local/faxes
backup  root@192.168.1.88:/home/        local/mails

And uncomment the localhost entries

Too make sure that cron will do the hard job for us:

# nano /etc/cron.d/rsnapshot

and uncomment so it looks like this

  GNU nano 2.0.2                                    File: /etc/cron.d/rsnapshot

# This is a sample cron file for rsnapshot.
# The values used correspond to the examples in /etc/rsnapshot.conf.
# There you can also set the backup points and many other things.
#
# To activate this cron file you have to uncomment the lines below.
# Feel free to adapt it to your needs.

 0 */4  * * *           root    /usr/bin/rsnapshot hourly
 30 3   * * *           root    /usr/bin/rsnapshot daily
 0  3   * * 1           root    /usr/bin/rsnapshot weekly
 30 2   1 * *           root    /usr/bin/rsnapshot monthly

rsnapshot will need ssh to do remote backups

# apt-get install openssh-server
# nano /etc/ssh/sshd_config

and make sure ssh only listens to the local address

ListenAddress 192.168.1.13

Too make sure that rsnapshot can login without a password

# ssh-keygen -t rsa

and accept the defaults without a passphrase

# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.8
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.10

</div>

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Links

Calendar

    September 2010
    M T W T F S S
    « Mar    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930