퍼펫 설정 파일 디렉터리 백업하기
전체 시스템을 제어하는 퍼펫Puppet 설정 파일 디렉터리, /etc/puppet를 바쿨라Bacula로 백업해봅시다. /etc/puppet은 로컬 호스트에 존재하므로 디렉터만 손보면 바로 백업이 가능합니다.
1 디렉터 설정 파일을 vi로 엽니다.
shinjaehun@losttemple:~$ sudo vi /etc/bacula/bacula-dir.conf
2 /usr/sbin 디렉터리를 백업하는 작업 BackupClient1은 주석처리하여 무효로 합니다.
#Job {
# Name = "BackupClient1"
# JobDefs = "DefaultJob"
#}
3 새로운 작업으로 PuppetMasterBackup을 추가합니다. 백업 대상 디렉터리를 PuppetFiles라는 이름의 FileSet으로 등록할 것입니다. 서버를 대상으로 하는 백업 작업을 ServerBackup이라는 풀로 등록해서 별도로 처리하겠습니다.
Job {
Name = "PuppetMasterBackup"
FileSet = PuppetFiles
JobDefs = DefaultJob
Pool = ServerBackup
}
4 PuppetFiles입니다. /etc/puppet 디렉터리를 대상으로 한다는 점을 제외하고 다른 파일 셋과 동일합니다. 파일을 저장합니다.
FileSet {
Name = "PuppetFiles"
Include {
Options {
signature = MD5
}
File = /etc/puppet
}
}
5 서버를 대상으로 하는 백업 작업을 별도로 묶기 위해 ServerBackup이라는 풀을 추가했습니다.
Pool {
Name = ServerBackup
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
Maximum Volume Bytes = 50G
}
6 디렉터를 재시작하고 콘솔을 실행합니다.
shinjaehun@losttemple:~$ sudo service bacula-director restart shinjaehun@losttemple:~$ sudo bconsole
7 label 명령으로 새로운 볼륨을 할당합니다. 볼륨 이름은 Vol001로, 새로 추가한 ServerBackup 풀에 볼륨을 생성합니다( 4).
*label Automatically selected Catalog: MyCatalog Using Catalog "MyCatalog" Automatically selected Storage: File 새로운 볼륨 이름을 입력: Vol001 Defined Pools: 1: Default 2: File 3: Scratch 4: ServerBackup Select the Pool (1-4): 4 Connecting to Storage daemon File at 192.168.122.1:9103 ... Sending label command for Volume "Vol001" Slot 0 ... 3000 OK label. VolBytes=206 DVD=0 Volume="Vol001" Device="FileStorage" (/mnt/backups) Catalog record for Volume "Vol001", Slot 0 successfully created. Requesting to mount FileStorage ... 3906 File device ""FileStorage" (/mnt/backups)" is always mounted.
8 run 명령으로 백업을 해보겠습니다. PuppetMasterBackup 작업을 선택하고( 1), yes를 입력해서 백업을 시작합니다. JobId 3번이 할당되었습니다.
*run A job name must be specified. The defined Job resources are: 1: PuppetMasterBackup 2: BackupCatalog 3: RestoreFiles Select Job resource (1-3): 1 Run Backup job JobName: PuppetMasterBackup Level: Incremental Client: losttemple-fd FileSet: PuppetFiles Pool: ServerBackup (From Job resource) Storage: File (From Job resource) When: 2014-11-04 00:39:11 Priority: 10 OK to run? (yes/mod/no): yes Job queued. JobId=3