백업

rdiff-backup

백업서버 구성

yum install rdiff-backup
/usr/bin/rdiff-backup --print-statistics --include-globbing-filelist /etc/rdiff-backup.list --exclude '**' /storage /backup/ | Mail -s "rdiff-bakcup Backup notice!!!" juni071027@i-pharm.org

/etc/rdiff-backup.list

/storage/works
/storage/home
/rdiff-backup --print-statistics --include-globbing-filelist /etc/rdiff-backup.list --exclude '**' /storage /backup/ > /var/log/rdiff-bakcup_`date '+2011%m%d'`.log < /dev/null &

클라이언트 구성

ssh key 인증 적용

백업(194)서버에서 비밀키 작성

[root@junix ~]# ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <- 그냥 Enter 키를 친다.(아무것도 입력안한다)
Enter same passphrase again: <- 그냥 Enter 키를 친다.(아무것도 입력안한다)
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
e0:62:99:ad:99:23:e1:d2:0a:cd:4e:24:7d:12:85:d5 root@junix.pe.kr

백업서버의 공개키를 대상 서버에 복사

[root@junix ~]# scp .ssh/id_rsa.pub web:/root

각각의 클라이언트에서 복사한 공개키로 /root/.ssh/authorized_keys 를 작성

[root@web .ssh]# cat id_rsa.pub >> /root/.ssh/authorized_keys

백업서버에서 클라이언트(web)으로 패스워드 없이 접속이 가능한지 확인

[root@junix ~]# ssh web

Last login: Thu Feb 8 22:39:03 2007 from 192.168.0.5

restore 방법

10일전의 백업본으로 복원하고자 한다면 아래와 같이 한다.

rdiff-backup -r 10D /backup/pp.i-pharm.org/ /tmp/pp-restore

백업의 하위 디렉토리만 지정하여 복원 할 수도 있다.

rdiff-backup -r 10D /backup/pp.i-pharm.org/opt/Accelrys /tmp/pp-restore

윈도우 머신에서 리눅스 서버로 백업

MySQL 백업

자동으로 백업하기

백업 쉘 스크리브