]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/templates/bacula-dir.conf.erb
16d9ccc18425d4cf8db1d76850aef02affcc8055
[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     File = /srv/chroot
57     File = /home/buildd/build-trees
58   }
59 }
60
61 ########################################################################
62 # A fileset for the catalog, one sql dump of the db                    #
63 ########################################################################
64 FileSet {
65   Name = "Catalog"
66   Include {
67     Options {
68       signature = SHA1
69       compression = GZIP9
70     }
71     File = "/var/lib/bacula/bacula.sql"
72   }
73 }
74
75 ########################################################################
76 # The job schedules                                                    #
77 ########################################################################
78
79 # When to do the backups, full backup on first sunday of the month,
80 #  differential (i.e. incremental since full) every other sunday,
81 #  and incremental backups other days
82 Schedule {
83   Name = "WeeklyCycle"
84   Run = Full 1st sat at 00:35
85   Run = Differential 2nd-5th sat at 00:35
86   Run = Incremental sun-fri at 00:35
87 }
88
89 # This schedule does the catalog. It starts after the WeeklyCycle
90 Schedule {
91   Name = "WeeklyCycleAfterBackup"
92   Run = Full sun-sat at 02:10
93 }
94
95 ########################################################################
96 # Generic catalog service                                              #
97 ########################################################################
98 Catalog {
99   Name = MyCatalog
100   dbname = bacula;
101   DB Address = "<%= bacula_db_address %>";
102   DB Port = <%= bacula_db_port %>;
103   dbuser = "bacula";
104   dbpassword = "<%= bacula_db_secret %>"
105 }
106
107 ########################################################################
108 # Message delivery                                                     #
109 ########################################################################
110 Messages {
111   Name = Standard
112   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
113   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
114   mail on error = <%= bacula_operator_email %> = all, !skipped
115   operator = <%= bacula_operator_email %> = mount
116   console = all, !skipped, !saved
117   append = "/var/lib/bacula/log" = all, !skipped
118   catalog = all
119 }
120
121 # Message delivery for daemon messages (no job).
122 Messages {
123   Name = Daemon
124   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
125   mail = <%= bacula_operator_email %> = all, !skipped
126   console = all, !skipped, !saved
127   append = "/var/lib/bacula/log" = all, !skipped
128 }
129
130 ########################################################################
131 # Storage config                                                       #
132 ########################################################################
133
134 Storage {
135   Name = <%= bacula_filestor_name %>
136   Address = <%= bacula_storage_address %>
137   SDPort = <%= bacula_storage_port %>
138   Password = "<%= bacula_storage_secret %>"
139   Device = <%= bacula_filestor_device %>
140   Media Type = <%= bacula_filestor_name %>
141   Maximum Concurrent Jobs = 10
142 }
143
144 ########################################################################
145 # Console, limited                                                     #
146 ########################################################################
147 Console {
148   Name = <%= bacula_monitor_name %>
149   Password = "<%= bacula_monitor_secret %>"
150   CommandACL = status, .status
151 }
152
153 ########################################################################
154 # Jobdefinitions with defaults and stuff                               #
155 ########################################################################
156 JobDefs {
157   Name = "Standardbackup"
158   Type = Backup
159   Level = Incremental
160   FileSet = "Standard Set"
161   Schedule = "WeeklyCycle"
162   Messages = Standard
163   Pool = <%=bacula_pool_name%>
164   Differential Backup Pool = <%=bacula_pool_name%>diff
165   Incremental Backup Pool = <%=bacula_pool_name%>inc
166   Max Full Interval = 1 month
167   Priority = 10
168   Write Bootstrap = "/var/lib/bacula/%c.bsr"
169   Maximum Concurrent Jobs = 20
170   Client Run After Job = "/usr/local/sbin/postbaculajob -c \"%c\" -d \"%d\" -i \"%i\" -l \"%l\" -n \"%n\" -o /var/log/bacula-main.log"
171 }
172
173 ########################################################################
174 # Standard Restore template, to be changed by Console program          #
175 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
176 ########################################################################
177 Job {
178   Name = "RestoreFiles"
179   Type = Restore
180   Client = draghi.debian.org-fd
181   FileSet = "Standard Set"
182   Pool = <%=bacula_pool_name%>
183   Messages = Standard
184   Where = /var/tmp/bacula-restores
185 }
186
187 ########################################################################
188 # Pool definition                                                      #
189 ########################################################################
190 Pool {
191   Name = <%= bacula_pool_name %>
192   Pool Type = Backup
193   Storage = <%=bacula_filestor_name%>
194   Recycle = no
195   AutoPrune = yes
196   Volume Retention = 1 year
197   Label Format = "<%= bacula_pool_name %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
198   Volume Use Duration = 23h
199   #Maximum Volume Jobs = 1
200   Maximum Volume Bytes = 50G
201   Action On Purge = Truncate
202 }
203
204 Pool {
205   Name = <%= bacula_pool_name %>diff
206   Pool Type = Backup
207   Storage = <%=bacula_filestor_name%>
208   Recycle = no
209   AutoPrune = yes
210   Volume Retention = 1 year
211   Label Format = "<%= bacula_pool_name %>diff.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
212   Volume Use Duration = 23h
213   #Maximum Volume Jobs = 1
214   Maximum Volume Bytes = 50G
215   Action On Purge = Truncate
216 }
217
218 Pool {
219   Name = <%= bacula_pool_name %>inc
220   Pool Type = Backup
221   Storage = <%=bacula_filestor_name%>
222   Recycle = no
223   AutoPrune = yes
224   Volume Retention = 1 year
225   Label Format = "<%= bacula_pool_name %>inc.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
226   Volume Use Duration = 23h
227   #Maximum Volume Jobs = 1
228   Maximum Volume Bytes = 50G
229   Action On Purge = Truncate
230 }
231
232 # Scratch pool definition
233 Pool {
234   Name = Scratch
235   Pool Type = Backup
236 }
237
238 ########################################################################
239 # Generic jobs                                                         #
240 ########################################################################
241 # Backup the catalog database (after the nightly save)
242 #Job {
243 #  Name = "BackupCatalog"
244 #  JobDefs = "Standardbackup"
245 #  Level = Full
246 #  FileSet="Catalog"
247 #  Schedule = "WeeklyCycleAfterBackup"
248 #  # This creates an ASCII copy of the catalog
249 #  # Arguments to make_catalog_backup.pl are:
250 #  #  make_catalog_backup.pl <catalog-name>
251 #  RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
252 #  # This deletes the copy of the catalog
253 #  RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
254 #  Write Bootstrap = "/var/lib/bacula/%n.bsr"
255 #  Priority = 15    # run after main backup
256 #  RunScript {
257 #        RunsWhen=After
258 #           RunsOnClient=No
259 #           Console = "purge volume action=all allpools storage=File"
260 #  }
261 #}
262
263 ########################################################################
264 # And now include all the generated configs                            #
265 ########################################################################
266 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"