Posted
Filed under Computer/Linux
Bacula-5.0.2를 이용하여 on-line으로 다른 컴퓨터들을 백업을 해보도록 하자.

우선은 backup 서버는 아래, 아래 글처럼 설치를 해준다.
이제는 client 노드를 설정해보자.


bacula-5.0.2.tar.gz를 다운 받은후에 컴파일을 해준다.
여기서 --with-fd-password 는 backup 서버의 bacula/etc/bacula-dir.conf 파일에서
이 client용으로 설정한 "Client { " 항목의 "Password = "의 값을 써준다.

# ./configure --prefix=/usr/local/bacula-5.0.2 --with-readline --with-fd-password="wvyPsGsBPRIgJKhyYV5C0+WJ9MTDR9epBKa/oftfQa/5"   --enable-client-only

# make

# make install

client용 데몬을 띄우기위해 환경설정을 해준다.
# cd /usr/local/bacula-5.0.2/etc/
# vi bacula-fd.conf

Director {
#  Name = rhel1-dir
  Name = cep-dir
  Password = "wvyPsGsBPRIgJKhyYV5C0+WJ9MTDR9epBKa/oftfQa/5"
}


나머지는 그냥두고 위의 항목에서 Name만 backup 서버의 Director Name으로 바꿔준다.
backup server의 bacula-dir.conf에서

Director {
  Name = cep-dir     #이 이름이 Director Name이다.
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/bacula-5.0.2/etc/query.sql"
  WorkingDirectory = "/usr/local/bacula-5.0.2/var/bacula/working"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "yJO****"         # Console password
  Messages = Daemon
}


그리고 bacula를 실행한다.

# ./bacula start
# ps -ef |grep bacula
# netstat -na | grep 910

이렇게 확인했을때 모두 잘 나오면 정상으로 설치된것이다.

##############
Backup server
##############
이제는 backup server에서 bacula/etc/bacula-dir.conf 파일을 수정해준다.
# vi bacula-dir.conf

추가한 client의 정보를 추가해준다.

Client {
  Name = rhel1-fd  #Client name(임의의 이름으로 본인이 알도록 정한다.)
  Address = rhel1  # hostname
  FDPort = 9102
  Catalog = MyCatalog
  Password = "wvyPsGsBPRIgJKhyYV5C0+WJ9MTDR9epBKa/oftfQa/5"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}


client에서 백업하고 싶은곳을 정의 해준다.
FileSet {
  Name = "RHEL1 Set"  #이름을 정해준다.
  Include {
    Options {
      signature = MD5
    }
    File = /usr              #백업하고 싶은 디렉토리를 정의 해준다.
  }
 
  Exclude {  #백업하면 안될 디렉토리를 정의해준다.
    File = /usr/local/bacula-5.0.2/var/bacula/working
    File = /tmp
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
  }
}


추가한 client용의 Job Definition을 추가 하고 싶다면 다른이름의 JobDefs 를 만들어준다.
JobDefs {
  Name = "RHEL1_BAK"
  Type = Backup
  Level = Incremental
  Client = rhel1-fd     # 백업하고 싶은 Client Name을 적어준다.
  FileSet = "RHEL1 Set"   # 백업하고 싶은 곳을 정의한 FileSet의 이름을 적어준다.
  Schedule = "WeeklyCycle"
  Storage = File
  Messages = Standard
  Pool = File
  Priority = 10
  Write Bootstrap = "/usr/local/bacula-5.0.2/var/bacula/working/%c.bsr"
}


console 명령어로 run을 실행할때 실행할 job 을 설정한다.
Job {
  Name = "BackupClient2"
  Client = rhel1-fd              #Client Name을 써준다.
  JobDefs = "RHEL1_BAK"  # JobDefs Name을 써준다.
}


다 되었으면 저장하고 나간후에 console로 들어간다.
# ./bconsole
수정한 configuration 정보를 갱신하기 위해서 reload를 해준다.
*reload
You have messages.

run 명령어로 rhel1 서버의 /usr를 백업한다.
*run
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
A job name must be specified.
The defined Job resources are:
     1: BackupClient1
     2: BackupClient2
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 2
Run Backup job
JobName:  BackupClient2
Level:    Incremental
Client:   rhel1-fd
FileSet:  RHEL1 Set
Pool:     File (From Job resource)
Storage:  File (From Job resource)
When:     2010-06-09 18:22:36
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=9
*

이렇게 하면 백업이 끝난다.
2010/06/09 18:29 2010/06/09 18:29
[로그인][오픈아이디란?]