Bacula
둘러보기로 가기
검색하러 가기
Network backup and Restore 솔루션인 Bacula에 대한 전반적인 사항을 정리한다.
- 홈페이지 : http://www.bacula.org/
- 다운로드 : http://sourceforge.net/project/showfiles.php?group_id=50727
- 라이센스 : GPL version 2 license
- 플랫폼 : Windows, Unix, Linux, Solaris, ...
목차
설치 가이드
설치전 사전 준비 사항
MySQL 정보 설정
- MySQL Catalog로 bacula, MySQL User로 bacula를 등록한다.
- 참조 : MySql Tools for 5.0 중 사용자와 Schema 등록을 참조
Bacula 설치
- 다운로드 사이트에서 Win32를 선택하여 "winbacula-2.4.2.exe" 파일을 다운로드 한다.
- 다운로드 받은 winbacula-2.4.2.exe 를 실행한다.
- "Next"를 선택하여 설치를 시작한다.
- "I Agree"를 선택하여 라이센스를 확인 한다.
- Automatic를 선택하고 Next를 선택하여 설치를 계속한다.
- Full을 선택하여 Server와 Client를 모두 설치한다. Document도 모두 설치할 것
- 필요한 설정 정보를 입력한 후 Install을 선택하여 설치를 한다.
- Password : MySQL 사용자 등록시 입력한 암호를 입력한다.
- Mail Server : 메일 서버의 URL을 입력한다.
- Mail Address : 메일 아이디를 입력한다.
- Database는 조금 전에 설치한 MySQL을 선택한다.
- Finish를 선택하여 설치를 종료한다.
- bacula-dir.conf 파일에서 올바른 암호를 등록한다.
- c:/Documents and Settings/All Users/Application Data/Bacula/bacula-dir.conf
# Generic catalog service Catalog { Name = MyCatalog dbname = bacula; user = bacula; password = "암호_입력할_것" }
- Bacula를 설치 완료하였음에서 데이터베이스에 테이블이 생성되지 않았을 경우, 다음 작업을 진행한다.
- bacula 사용자로 MySQL Query Browser에 로그인한다.
- c:/Program Files/Bacula/bin/make_mysql_tables.sql 파일에 명시된 테이블 등을 수작업으로 모두 생성한다.
사용자 가이드
서비스 기동/확인/종료
- 서비스 기동
- 시작 -> 모든 프로그램 -> Bacula에서 Start Storage Service를 시작한다. (bacula-sd.exe)
- 시작 -> 모든 프로그램 -> Bacula에서 Start File Service를 시작한다. (bacula-fd.exe)
- 시작 -> 모든 프로그램 -> Bacula에서 Start DirectorService를 시작한다. (bacula-dir.exe)
- 서비스 확인
C:/>netstat -an | findstr 910 TCP 0.0.0.0:9101 0.0.0.0:0 LISTENING TCP 0.0.0.0:9102 0.0.0.0:0 LISTENING TCP 0.0.0.0:9103 0.0.0.0:0 LISTENING
- 서비스 종료
- Windows 작업 관리자에서 bacula-dir.exe 프로세스를 강제 종료한다.
- Windows 작업 관리자에서 bacula-fd.exe 프로세스를 강제 종료한다.
- Windows 작업 관리자에서 bacula-sd.exe 프로세스를 강제 종료한다.
테스트 백업 실행
- bacula-sd.conf 파일에서 FileStorage라는 Device 블럭에서 지정한 Archive Device에 해당하는 디렉토리를 생성한다.
Device { Name = FileStorage Media Type = File Archive Device = "C:\\Tmp" # 여기서 지정한 c:/tmp 디렉토리를 생성한다. LabelMedia = yes # lets Bacula label unlabeled media Random Access = Yes AutomaticMount = yes # when device opened, read it RemovableMedia = no AlwaysOpen = no }
- 시작 -> 모든 프로그램 -> Bacula 에서 bwx-console을 실행한다.
- 명령행에서 run을 실행한 후, Client1을 선택하고 yes를 선택하여 백업을 실행한다.
- 혹시 라벨이 없다는 에러가 발생할 경우, 명령행에서 label을 입력하고, Volume name으로 demo를 입력하고 1(Default Pool)을 선택하여 라벨을 생성한 후 다시 위 명령을 실행한다.
- bacula-dir.conf
JobDefs { Name = "DefaultJob" Type = Backup Level = Incremental Client = main-fd FileSet = "Test Set" # 백업할 파일셋 명 Schedule = "WeeklyCycle" # Schedule 명 Storage = File # 저장할 Storage 명 (File Storage에서 FileStorage Device를 사용함) Messages = Standard Pool = Default Priority = 10 } Job { Name = "Client1" JobDefs = "DefaultJob" Write Bootstrap = "F:\\Documents and Settings\\All Users\\Application Data\\Bacula\\Work\\Client1.bsr" }
Console 명령어
add add media to a pool autodisplay autodisplay [on|off] -- console messages automount automount [on|off] -- after label cancel cancel [<jobid=nnn> | <job=name>] -- cancel a job create create DB Pool from resource delete delete [pool=<pool-name> | media volume=<volume-name>] disable disable <job=name> -- disable a job enable enable <job=name> -- enable a job estimate performs FileSet estimate, listing gives full listing exit exit = quit gui gui [on|off] -- non-interactive gui mode help print this command list list [pools | jobs | jobtotals | media <pool=pool-name> | files <jobid=nn>]; from catalog label label a tape llist full or long list like list command messages messages memory print current memory usage mount mount <storage-name> prune prune expired records from catalog purge purge records from catalog python python control commands quit quit query query catalog restore restore files relabel relabel a tape release release <storage-name> reload reload conf file run run <job-name> status status [storage | client]=<name> setdebug sets debug level setip sets new client address -- if authorized show show (resource records) [jobs | pools | ... | all] sqlquery use SQL to query catalog time print current time trace turn on/off trace to file unmount unmount <storage-name> umount umount <storage-name> for old-time Unix guys update update Volume, Pool or slots use use catalog xxx var does variable expansion version print Director version wait wait until no jobs are running [<jobname=name> | <jobid=nnn> | <ujobid=complete_name>]