Skip to content

Instantly share code, notes, and snippets.

@optiz0r
Last active August 29, 2015 14:27
Show Gist options
  • Save optiz0r/4b2bdd08dea6fcfac4f0 to your computer and use it in GitHub Desktop.
Save optiz0r/4b2bdd08dea6fcfac4f0 to your computer and use it in GitHub Desktop.
Bacula virtual autochanger
Storage {
Name = <%= @hostname %>-sd
SDPort = 9103
WorkingDirectory = <%= scope.lookupvar('bacula::real_working_dir') %>
Pid Directory = "/var/run"
}
Director {
Name = <%= scope.lookupvar('bacula::director_name') %>
Password = "<%= scope.lookupvar('bacula::sd_password') %>"
}
Messages {
Name = Standard
director = <%= scope.lookupvar('bacula::director_name') %> = all
}
##### Disk storage #####
Autochanger {
Name = <%= @hostname %>-autochanger
Device = drive-restore-<%= @hostname %>, drive-1-<%= @hostname %>
Device = drive-2-<%= @hostname %>, drive-3-<%= @hostname %>
Device = drive-4-<%= @hostname %>, drive-5-<%= @hostname %>
Changer Device = <%= @storage_path%>/<%= @hostname %>-autochanger.conf
Changer Command = "<%= @sd_disk_changer %> %c %o %S %a %d"
}
Device {
Name = drive-restore-<%= @hostname %>
Archive Device = <%= @storage_path %>/<%= @hostname %>-autochanger/drive0
Device Type = File
Media Type = File-<%= @hostname %>
AutoChanger = yes
Removable media = no
Random access = yes
Requires Mount = no
Always Open = no
Label Media = no
Maximum Changer Wait = 180
Drive Index = 0
# Only used when manually specified
# To be used for volume admin and restore jobs
Autoselect = no
Maximum Spool Size = 100G
}
Device {
Name = drive-1-<%= @hostname %>
Archive Device = <%= @storage_path %>/<%= @hostname %>-autochanger/drive1
Device Type = File
Media Type = File-<%= @hostname %>
AutoChanger = yes
Removable media = no
Random access = yes
Requires Mount = no
Always Open = no
Label Media = no
Maximum Changer Wait = 180
Drive Index = 1
Autoselect = yes
Maximum Spool Size = 100G
Maximum Concurrent Jobs = 1
}
##### Manual pruning #####
# Automatic pruning after every job/ while looking for new volumes is causing
# a performance hit. Manually run prunes once a day instead
job {
Name = "PruneExpiredVolumes"
Type = Admin
Messages = Standard
Allow Mixed Priority = yes
Priority = 3
RunScript {
Console = "prune expired volume yes"
RunsOnClient = no
RunsWhen = Before
}
# Dummy values, required but not used
Pool = CatalogPool
Client = <%= @fqdn %>-catalog
FileSet = CatalogFileSet
Schedule = PruningSchedule
}
Schedule {
Name = PruningSchedule
Run = daily at 06:30
}
##### Scratch Pool #####
Pool {
# Magic name, volumes are taken from this pool when another pool fills up
Name = Scratch
Pool Type = Backup
Label Format = Scratch-
Recycle = yes
# This attribute stays with the tape and is not updated to reflect the Pool its moved into
# Send tapes back to this pool when they are recycled
Recycle Pool = Scratch
}
##### Site-specific config #####
@<%= @dir_config %>.d/filesets.conf
@<%= @dir_config %>.d/jobdefs.conf
@<%= @dir_config %>.d/pools.conf
@<%= @dir_config %>.d/schedules.conf
@<%= @dir_config %>.d/storage.conf
@|"/bin/sh -c 'ls <%= @dir_config %>.d/clients/*.conf >/dev/null 2>&1 && cat <%= @dir_config %>.d/clients/*.conf'"
@|"/bin/sh -c 'ls <%= @dir_config %>.d/services/*.conf >/dev/null 2>&1 && cat <%= @dir_config %>.d/services/*.conf'"
Storage {
Name = backup1-sd
Address = backup1.local
SDPort = 9103
Password = "<%= scope.lookupvar('bacula::sd_password') %>"
Device = backup1-autochanger
Media Type = File-backup1
Autochanger = yes
Maximum Concurrent Jobs = 5
}
Pool {
Name = Disk-90Day-backup3
Pool Type = Backup
Recycle = yes
Recycle Pool = Scratch
AutoPrune = no
Job Retention = 90 days
Volume Retention = 90 days
Storage = backup1-sd
Maximum Volume Bytes = 100G
Maximum Volumes = 250
}
Pool {
Name = Disk-60Day-backup3
Pool Type = Backup
Recycle = yes
Recycle Pool = Scratch
AutoPrune = no
Job Retention = 60 days
Volume Retention = 60 days
Storage = backup1-sd
Maximum Volume Bytes = 100G
Maximum Volumes = 0
}
Pool {
Name = Disk-45Day-backup1
Pool Type = Backup
Recycle = yes
Recycle Pool = Scratch
AutoPrune = no
Job Retention = 45 days
Volume Retention = 45 days
Storage = backup1-sd
Maximum Volume Bytes = 100G
Maximum Volumes = 400
}
maxdrive=5
maxslot=1700
1:backup1-autochanger-0001
2:backup1-autochanger-0002
3:backup1-autochanger-0003
4:backup1-autochanger-0004
5:backup1-autochanger-0005
6:backup1-autochanger-0006
7:backup1-autochanger-0007
8:backup1-autochanger-0008
9:backup1-autochanger-0009
10:backup1-autochanger-0010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment