Navigation
Artikel
Stuff
RSS Feeds
|
Tutorials - BaculaSprachenübersicht/Betriebssysteme/Linux/Backup Keywords: bacula backup server howto tutorial InhaltsverzeichnisVorwort Top
Funktion Top
Installation Top
Konfiguration Top
/etc/bacula/bacula-dir.conf: Director { Name = bacula-dir DIRport = 9101 QueryFile = "/etc/bacula/scripts/query.sql" WorkingDirectory = "/var/lib/bacula" PidDirectory = "/var/run/bacula" Maximum Concurrent Jobs = 1 Password = "my-bacula-pass" # Console password Messages = Daemon DirAddress = 127.0.0.1 } JobDefs { Name = "DefaultJob" Type = Backup Level = Incremental Client = bacula-fd FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = lokal Messages = Standard Pool = backup-folder Priority = 10 } # # Define the main nightly save backup job Job { Name = "Server1" Client = server1-fd JobDefs = "DefaultJob" Write Bootstrap = "/var/lib/bacula/Server1.bsr" } Job { Name = "Server2" Client = server2-fd JobDefs = "DefaultJob" Write Bootstrap = "/var/lib/bacula/Server2.bsr" } # Backup the catalog database (after the nightly save) Job { Name = "BackupCatalog" JobDefs = "DefaultJob" Level = Full FileSet="Catalog" Schedule = "WeeklyCycleAfterBackup" # This creates an ASCII copy of the catalog RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup bacula" # This deletes the copy of the catalog RunAfterJob = "/etc/bacula/scripts/delete_catalog_backup" Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr" Priority = 11 # run after main backup } # # Standard Restore template, to be changed by Console program # Only one such job is needed for all Jobs/Clients/Storage ... # Job { Name = "RestoreFiles" Type = Restore Client=bacula-fd FileSet="Full Set" Storage = lokal Pool = backup-folder Messages = Standard Where = /tmp/bacula-restores } # List of files to be backed up FileSet { Name = "Full Set" Include { Options { signature = MD5 onefs = no } # # Put your list of files here, preceded by 'File =', one per line # or include an external list with: # # File = file-name File = / } # # If you backup the root directory, the following two excluded # files can be useful # Exclude { File = /proc File = /tmp File = /.journal File = /.fsck File = /sys File = /dev } } # # # When to do the backups, full backup on first sunday of the month, # differential (i.e. incremental since full) every other sunday, # and incremental backups other days Schedule { Name = "WeeklyCycle" Run = Full 1st 3rd sun at 02:05 Run = Differential 2nd 4th 5th sun at 02:05 Run = Incremental mon tue wed thu fri sat at 02:05 } # This schedule does the catalog. It starts after the WeeklyCycle Schedule { Name = "WeeklyCycleAfterBackup" Run = Full sun-sat at 02:10 } # This is the backup of the catalog FileSet { Name = "Catalog" Include { Options { signature = MD5 } File = /var/lib/bacula/bacula.sql } } # Client (File Services) to backup Client { Name = bacula-fd Address = bacula # hostname des bacula servers FDPort = 9102 Catalog = MyCatalog Password = "bacula-fd-password" # password for FileDaemon File Retention = 3 weeks Job Retention = 3 weeks AutoPrune = yes # Prune expired Jobs/Files } Client { Name = server1-fd Address = server1.example.com FDPort = 9102 Catalog = MyCatalog Password = "server1-fd-password" File Retention = 3 weeks Job Retention = 3 weeks AutoPrune = yes } Client { Name = server2-fd Address = server2.example.com FDPort = 9102 Catalog = MyCatalog Password = "server2-fd-password" File Retention = 3 weeks Job Retention = 3 weeks AutoPrune = yes } # Definition of file storage device Storage { Name = lokal # Do not use "localhost" here Address = bacula.example.com # Use a fully qualified name here SDPort = 9103 Password = "bacula-sd-password" Device = Local-Storage Media Type = File } # Generic catalog service Catalog { Name = MyCatalog dbname = bacula; DB Address = ""; user = bacula; password = "" } # Reasonable message delivery -- send most everything to email address # and to the console Messages { Name = Standard # # NOTE! If you send to two email or more email addresses, you will need # to replace the %r in the from field (-f part) with a single valid # email address in both the mailcommand and the operatorcommand. # mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r" operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r" mail = sysadmin@example.com = all, !skipped operator = sysadmin@example.com = mount console = all, !skipped, !saved # # WARNING! the following will create a file that you must cycle from # time to time as it will grow indefinitely. However, it will # also keep all your messages if they scroll off the console. # append = "/var/lib/bacula/log" = all, !skipped } # Message delivery for daemon messages (no job). Messages { Name = Daemon mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r" mail = sysadmin@example.com = all, !skipped console = all, !skipped, !saved append = "/var/lib/bacula/log" = all, !skipped } Pool { Name = backup-folder Pool Type = Backup Recycle = yes # Bacula can automatically recycle Volumes AutoPrune = yes # Prune expired volumes Volume Retention = 3 weeks Accept Any Volume = yes # write on any volume in the pool Label Format = "file-" Maximum Volume Bytes = 50G Maximum Volumes = 18 # about 1 TB }
/etc/bacula/bacula-fd.conf: Director { Name = bacula-dir Password = "bacula-fd-password" } FileDaemon { Name = bacula-fd FDport = 9102 WorkingDirectory = /var/lib/bacula Pid Directory = /var/run/bacula Maximum Concurrent Jobs = 20 } # Send all messages except skipped files back to Director Messages { Name = Standard director = bacula-dir = all, !skipped, !restored }
/etc/bacula/bacula-sd.conf: Storage { Name = bacula-sd SDPort = 9103 WorkingDirectory = "/var/lib/bacula" Pid Directory = "/var/run/bacula" Maximum Concurrent Jobs = 20 } Director { Name = bacula-dir Password = "bacula-sd-password" } # # Devices supported by this Storage daemon # To connect, the Director's bacula-dir.conf must have the # same Name and MediaType. # Device { Name = Local-Storage Media Type = File Archive Device = /var/bacula LabelMedia = yes; # lets Bacula label unlabeled media Random Access = Yes; AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; } # # Send all messages to the Director, # mount messages also are sent to the email address # Messages { Name = Standard director = bacula-dir = all }
/etc/bacula/bconsole.conf: Director { Name = bacula-dir DIRport = 9101 address = localhost Password = "my-bacula-pass" }
/etc/bacula/bacula-fd.conf: Director { Name = bacula-dir Password = "server1-fd-password" } FileDaemon { Name = server1-fd FDport = 9102 WorkingDirectory = /var/lib/bacula Pid Directory = /var/run/bacula Maximum Concurrent Jobs = 20 } # Send all messages except skipped files back to Director Messages { Name = Standard director = bacula-dir = all, !skipped, !restored }
Betrieb Top
Code: *list media Using default Catalog name=MyCatalog DB=bacula Pool: lokal +---------+------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+ | MediaId | VolumeName | VolStatus | VolBytes | VolFiles | VolRetention | Recycle | Slot | InChanger | MediaType | LastWritten | +---------+------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+ | 69 | file-0001 | Full | 53,687,083,249 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-09-15 02:27:11 | | 70 | file-0002 | Full | 53,687,050,764 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-09-16 02:40:56 | | 71 | file-0003 | Full | 53,687,085,117 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-09-18 02:16:55 | | 72 | file-0004 | Append | 32,759,321,969 | 7 | 1,814,400 | 1 | 0 | 0 | File | 2007-09-18 02:36:13 | | 73 | file-0005 | Purged | 53,687,051,689 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-08-26 02:19:34 | | 74 | file-0006 | Full | 53,687,068,527 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-08-28 02:19:16 | | 75 | file-0007 | Full | 53,687,037,253 | 12 | 1,814,400 | 1 | 0 | 0 | File | 2007-08-30 02:18:26 | +---------+------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
Schlusswort Top
Gibt es noch irgendwelche Fragen, oder wollen Sie über den Artikel diskutieren? |