]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/templates/bacula-dir.conf.erb
Put db port and address into configuration too
[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;
99   DB Address = "<%= bacula_db_address %>";
100   DB Port = <%= bacula_db_port %>;
101   dbuser = "bacula";
102   dbpassword = "<%= bacula_db_secret %>"
103 }
104
105 ########################################################################
106 # Message delivery                                                     #
107 ########################################################################
108 Messages {
109   Name = Standard
110   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
111   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
112   mail = <%= bacula_operator_email %> = all, !skipped
113   operator = <%= bacula_operator_email %> = mount
114   console = all, !skipped, !saved
115   append = "/var/lib/bacula/log" = all, !skipped
116   catalog = all
117 }
118
119 # Message delivery for daemon messages (no job).
120 Messages {
121   Name = Daemon
122   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
123   mail = <%= bacula_operator_email %> = all, !skipped
124   console = all, !skipped, !saved
125   append = "/var/lib/bacula/log" = all, !skipped
126 }
127
128 ########################################################################
129 # Storage config                                                       #
130 ########################################################################
131
132 Storage {
133   Name = <%= bacula_filestor_name %>
134   Address = <%= bacula_storage_address %>
135   SDPort = <%= bacula_storage_port %>
136   Password = "<%= bacula_storage_secret %>"
137   Device = <%= bacula_filestor_device %>
138   Media Type = <%= bacula_filestor_name %>
139   Maximum Concurrent Jobs = 10
140 }
141
142 ########################################################################
143 # Console, limited                                                     #
144 ########################################################################
145 Console {
146   Name = <%= bacula_monitor_name %>
147   Password = "<%= bacula_monitor_secret %>"
148   CommandACL = status, .status
149 }
150
151 ########################################################################
152 # Jobdefinitions with defaults and stuff                               #
153 ########################################################################
154 JobDefs {
155   Name = "Standardbackup"
156   Type = Backup
157   Level = Incremental
158   FileSet = "Standard Set"
159   Schedule = "WeeklyCycle"
160   Storage = <%=bacula_filestor_name%>
161   Messages = Standard
162   Pool = <%=bacula_pool_name%>
163   Differential Backup Pool = <%=bacula_pool_name%>diff
164   Incremental Backup Pool = <%=bacula_pool_name%>inc
165   Max Full Interval = 1 month
166   Priority = 10
167   Write Bootstrap = "/var/lib/bacula/%c.bsr"
168   Maximum Concurrent Jobs = 20
169 }
170
171 ########################################################################
172 # Pool definition                                                      #
173 ########################################################################
174 Pool {
175   Name = <%= bacula_pool_name %>
176   Pool Type = Backup
177   Recycle = no
178   AutoPrune = yes
179   Volume Retention = 1 year
180   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
181   Volume Use Duration = 23h
182   Maximum Volume Jobs = 1
183   Maximum Volume Bytes = 50G
184   Action On Purge = Truncate
185 }
186
187 Pool {
188   Name = <%= bacula_pool_name %>diff
189   Pool Type = Backup
190   Recycle = no
191   AutoPrune = yes
192   Volume Retention = 1 year
193   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
194   Volume Use Duration = 23h
195   Maximum Volume Jobs = 1
196   Maximum Volume Bytes = 50G
197   Action On Purge = Truncate
198 }
199
200 Pool {
201   Name = <%= bacula_pool_name %>inc
202   Pool Type = Backup
203   Recycle = no
204   AutoPrune = yes
205   Volume Retention = 1 year
206   Label Format = "${Client}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
207   Volume Use Duration = 23h
208   Maximum Volume Jobs = 1
209   Maximum Volume Bytes = 50G
210   Action On Purge = Truncate
211 }
212
213 # Scratch pool definition
214 Pool {
215   Name = Scratch
216   Pool Type = Backup
217 }
218
219 ########################################################################
220 # Generic jobs                                                         #
221 ########################################################################
222 # Backup the catalog database (after the nightly save)
223 #Job {
224 #  Name = "BackupCatalog"
225 #  JobDefs = "Standardbackup"
226 #  Level = Full
227 #  FileSet="Catalog"
228 #  Schedule = "WeeklyCycleAfterBackup"
229 #  # This creates an ASCII copy of the catalog
230 #  # Arguments to make_catalog_backup.pl are:
231 #  #  make_catalog_backup.pl <catalog-name>
232 #  RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
233 #  # This deletes the copy of the catalog
234 #  RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
235 #  Write Bootstrap = "/var/lib/bacula/%n.bsr"
236 #  Priority = 15    # run after main backup
237 #  RunScript {
238 #        RunsWhen=After
239 #           RunsOnClient=No
240 #           Console = "purge volume action=all allpools storage=File"
241 #  }
242 #}
243
244 ########################################################################
245 # And now include all the generated configs                            #
246 ########################################################################
247 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"