]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/templates/bacula-dir.conf.erb
More bits of bacula
[dsa-puppet.git] / modules / bacula / templates / bacula-dir.conf.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5 ##
6 #  For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
7
8 ########################################################################
9 # Bacula Director itself                                               #
10 ########################################################################
11
12 Director {
13   Name = <%= bacula_director_name %>
14   Description = <%= hostname %> - <%= domain %> Bacula Director
15   QueryFile = "/etc/bacula/scripts/query.sql"
16   WorkingDirectory = "/var/lib/bacula"
17   PidDirectory = "/var/run/bacula"
18   Maximum Concurrent Jobs = 20
19   Password = "<%= bacula_director_secret %>"
20   Messages = Daemon
21   DirAddresses = {
22      # Always have localhost in, then the configured IP
23      ip = { addr = 127.0.0.1; port = 9101 }
24          ip = { addr = <%=bacula_director_address%>; port = <%=bacula_director_port%> }
25   }
26 }
27
28 ########################################################################
29 # Standard Fileset                                                     #
30 ########################################################################
31 FileSet {
32   Name = "Standard Set"
33   Include {
34     Options {
35       signature = SHA1
36       compression = GZIP9
37     }
38     File = "\\|bash -c \"df -Pkl -x tmpfs | tail -n +2 | awk '{print \$NF}' \""
39     # Dont backup directories that contain .nobackup files
40     Exclude Dir Containing = .nobackup
41   }
42
43   Exclude {
44     File = /var/lib/bacula
45     File = /var/cache/apt/
46     File = /nonexistant
47     File = /proc
48     File = /tmp
49     File = /.journal
50     File = /.fsck
51     File = /sys
52     File = /lib/init/rw
53     File = /var/run
54     File = /var/lock
55     File = /dev
56   }
57 }
58
59 ########################################################################
60 # A fileset for the catalog, one sql dump of the db                    #
61 ########################################################################
62 FileSet {
63   Name = "Catalog"
64   Include {
65     Options {
66       signature = SHA1
67       compression = GZIP9
68     }
69     File = "/var/lib/bacula/bacula.sql"
70   }
71 }
72
73 ########################################################################
74 # The job schedules                                                    #
75 ########################################################################
76
77 # When to do the backups, full backup on first sunday of the month,
78 #  differential (i.e. incremental since full) every other sunday,
79 #  and incremental backups other days
80 Schedule {
81   Name = "WeeklyCycle"
82   Run = Full 1st sat at 00:35
83   Run = Differential 2nd-5th sat at 00:35
84   Run = Incremental sun-fri at 00:35
85 }
86
87 # This schedule does the catalog. It starts after the WeeklyCycle
88 Schedule {
89   Name = "WeeklyCycleAfterBackup"
90   Run = Full sun-sat at 02:10
91 }
92
93 ########################################################################
94 # Generic catalog service                                              #
95 ########################################################################
96 Catalog {
97   Name = MyCatalog
98   dbname = bacula; DB Address = ""; dbuser = "bacula"; dbpassword = "s3kr1t"
99 }
100
101 ########################################################################
102 # Message delivery                                                     #
103 ########################################################################
104 Messages {
105   Name = Standard
106   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
107   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
108   mail = <%= bacula_operator_email %> = all, !skipped
109   operator = <%= bacula_operator_email %> = mount
110   console = all, !skipped, !saved
111   append = "/var/lib/bacula/log" = all, !skipped
112   catalog = all
113 }
114
115 # Message delivery for daemon messages (no job).
116 Messages {
117   Name = Daemon
118   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
119   mail = <%= bacula_operator_email %> = all, !skipped
120   console = all, !skipped, !saved
121   append = "/var/lib/bacula/log" = all, !skipped
122 }
123
124 ########################################################################
125 # Storage config                                                       #
126 ########################################################################
127
128 Storage {
129   Name = <%= bacula_filestor_name %>
130   Address = <%= bacula_storage_address %>
131   SDPort = <%= bacula_storage_port %>
132   Password = "<%= bacula_storage_secret %>"
133   Device = <%= bacula_filestor_device %>
134   Media Type = <%= bacula_filestor_name %>
135   Maximum Concurrent Jobs = 10
136 }
137
138 ########################################################################
139 # Console, limited                                                     #
140 ########################################################################
141 Console {
142   Name = <%= bacula_monitor_name %>
143   Password = "<%= bacula_monitor_secret %>"
144   CommandACL = status, .status
145 }
146
147 ########################################################################
148 # Jobdefinitions with defaults and stuff                               #
149 ########################################################################
150 JobDefs {
151   Name = "Standardbackup"
152   Type = Backup
153   Level = Incremental
154   FileSet = "Standard Set"
155   Schedule = "WeeklyCycle"
156   Storage = <%=bacula_filestor_name%>
157   Messages = Standard
158   Pool = <%=bacula_pool_name%>
159   Differential Backup Pool = <%=bacula_pool_name%>diff
160   Incremental Backup Pool = <%=bacula_pool_name%>inc
161   Max Full Interval = 1 month
162   Priority = 10
163   Write Bootstrap = "/var/lib/bacula/%c.bsr"
164   Maximum Concurrent Jobs = 20
165 }
166
167 ########################################################################
168 # Pool definition                                                      #
169 ########################################################################
170 Pool {
171   Name = <%= bacula_pool_name %>
172   Pool Type = Backup
173   Recycle = no
174   AutoPrune = yes
175   Volume Retention = 1 year
176   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
177   Volume Use Duration = 23h
178   Maximum Volume Jobs = 1
179   Maximum Volume Bytes = 50G
180   Action On Purge = Truncate
181 }
182
183 Pool {
184   Name = <%= bacula_pool_name %>diff
185   Pool Type = Backup
186   Recycle = no
187   AutoPrune = yes
188   Volume Retention = 1 year
189   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
190   Volume Use Duration = 23h
191   Maximum Volume Jobs = 1
192   Maximum Volume Bytes = 50G
193   Action On Purge = Truncate
194 }
195
196 Pool {
197   Name = <%= bacula_pool_name %>inc
198   Pool Type = Backup
199   Recycle = no
200   AutoPrune = yes
201   Volume Retention = 1 year
202   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
203   Volume Use Duration = 23h
204   Maximum Volume Jobs = 1
205   Maximum Volume Bytes = 50G
206   Action On Purge = Truncate
207 }
208
209 # Scratch pool definition
210 Pool {
211   Name = Scratch
212   Pool Type = Backup
213 }
214
215 ########################################################################
216 # Generic jobs                                                         #
217 ########################################################################
218 # Backup the catalog database (after the nightly save)
219 Job {
220   Name = "BackupCatalog"
221   JobDefs = "Standardbackup"
222   Level = Full
223   FileSet="Catalog"
224   Schedule = "WeeklyCycleAfterBackup"
225   # This creates an ASCII copy of the catalog
226   # Arguments to make_catalog_backup.pl are:
227   #  make_catalog_backup.pl <catalog-name>
228   RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
229   # This deletes the copy of the catalog
230   RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
231   Write Bootstrap = "/var/lib/bacula/%n.bsr"
232   Priority = 15    # run after main backup
233   RunScript {
234         RunsWhen=After
235             RunsOnClient=No
236             Console = "purge volume action=all allpools storage=File"
237   }
238  # Wonder how i can get this to be dynamic. FIXME.
239  Client = barbrady-fd
240 }
241
242 ########################################################################
243 # And now include all the generated configs                            #
244 ########################################################################
245 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"