Bacula - client setup

From Skytech
Jump to: navigation, search


Server

På serversiden skal der redigeres i 1 fil, /etc/bacula/bacula-dir.conf

FileSet

Under FileSet tilføj:


######## wiki #########
FileSet {
  Name = "wiki"
  Include {
    Options { signature = MD5 }

    File = /etc
    File = /var/www
    File = /var/lib/mysql
    File = /usr/local/sbin
  }

  Exclude {
    File = /prot
    File = /tmp
    File = /.journal
    File = /.fsck
    File = /var/log
  }
}

Tilpas selvfølgelig således den tager backup af det rigtige.

Man kan bruge regular expressions i sine sti-definitioner, så File = /usr/[lL]ocal/[1-9]{2}* vil være helt lovligt fx.

Job

Tilføj nu jobbet (vær opmærksom på, der er 3 jobs pr server.. en daglig, ugentlig og mdr. backup - alle 3 skal udfyldes!)

######## wiki ############
Job {
  Name = "wiki-weekly"
  Type = Backup
  Client = wikiserver.local.dk
  FileSet = "wiki"
  Schedule = "WeeklyCycle"
  Storage = storage
  Messages = Standard
  Pool = weekly
  Write Bootstrap = "/mnt/backup/bacula/wiki.bsr"
  Max Wait Time = 15m
  RunAfterJob = "/usr/local/sbin/logstatus.pl 'success' '%c' '%n' '%e'"
  RunAfterFailedJob = "/usr/local/sbin/logstatus.pl 'fail' '%c' '%n' '%e'"
}

Job {
  Name = "wiki-daily"
  Type = Backup
  Client = wikiserver.local.dk
  FileSet = "wiki"
  Schedule = "DailyCycle"
  Storage = storage
  Messages = Standard
  Pool = daily
  Write Bootstrap = "/mnt/backup/bacula/wiki.bsr"
  Max Wait Time = 15m
  RunAfterJob = "/usr/local/sbin/logstatus.pl 'success' '%c' '%n' '%e'"
  RunAfterFailedJob = "/usr/local/sbin/logstatus.pl 'fail' '%c' '%n' '%e'"
}

Job {
  Name = "wiki-monthly"
  Type = Backup
  Client = wikiserver.local.dk
  FileSet = "wiki"
  Schedule = "MonthlyCycle"
  Storage = storage
  Messages = Standard
  Pool = monthly
  Write Bootstrap = "/mnt/backup/bacula/wiki.bsr"
  Max Wait Time = 15m
  RunAfterJob = "/usr/local/sbin/logstatus.pl 'success' '%c' '%n' '%e'"
  RunAfterFailedJob = "/usr/local/sbin/logstatus.pl 'fail' '%c' '%n' '%e'"
}

Client

Tilføj under client delen (nederst i configfilen)

######### wiki ############
Client {
  Name = wikiserver.local.dk
  Address = servername.dk
  FDPort = 9102
  Catalog = catalog
  Password = ""                  
  File Retention = 8 days                
  Job Retention = 180d                
  AutoPrune = yes                     
}

Klient

Åbn bacula-fd.conf (oftest i /etc/bacula/bacula-fd.conf)

Debian

Installere bacula-fd på klienterne

apt-get install bacula-fd

editér /etc/bacula/bacula-fd.conf

Husk at redigere Name under FileDaemon!!!!

Director {
  Name = backup
  Password = ""
}

Director {
  Name = backup-mon
  Password = ""
  Monitor = yes
}

FileDaemon {                          # this is me
  Name = wikiserver.local.dk
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run/bacula
  Maximum Concurrent Jobs = 20
}

Messages {
  Name = Standard
  director = backup = all, !skipped
}

Redhat 8.0

Det er _IKKE_ muligt få bacula til at køre på redhat < 7. Skal det være en anden version af redhat skal man selv bygge den ud fra src rpm'en

Hent rpm og installer

rpm -ivh bacula-client-2.2.8-2.i386.rpm
mkdir /var/run/bacula

Brug bacula opsætningen fra debian hvis bacula version > 1

Bacula version < 2

Redigér bacula-fd.conf

Director {
  Name = backup
  Password = ""
}

FileDaemon {                          # this is me
  Name = wikiserver.local.dk
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}

Messages {
  Name = Standard
  director = backup = all, !skipped
}

Tilføj til opstart

Sørg for bacula starter op ved reboot

chkconfig bacula-fd on