Do not backup the Apache disk cache
[mirror/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   TLS Enable = yes
28   TLS Require = yes
29   TLS Verify Peer = yes
30   TLS Allowed CN = "clientcerts/<%= @bacula_director_address %>"
31   TLS CA Certificate File = "<%= @bacula_ca_path %>"
32   # This is a server certificate, used for incoming console connections.
33   TLS Certificate = "<%= @bacula_ssl_server_cert %>"
34   TLS Key = "<%= @bacula_ssl_server_key %>"
35 }
36
37 ########################################################################
38 # Standard Fileset                                                     #
39 ########################################################################
40 FileSet {
41   Name = "Standard Set"
42   Ignore FileSet Changes = yes
43   Include {
44     Options {
45       signature = SHA1
46       compression = GZIP9
47       aclsupport = yes
48       xattrsupport = yes
49     }
50     Options {
51       wild = "/swapfile*"
52       exclude = yes
53     }
54     File = "\\|/usr/local/sbin/bacula-backup-dirs"
55     # Dont backup directories that contain .nobackup files
56     Exclude Dir Containing = .nobackup
57   }
58
59   Exclude {
60     File = /.fsck
61     File = /.journal
62     File = /dev
63     File = /home/buildd/build-trees
64     File = /lib/init/rw
65     File = /nonexistant
66     File = /proc
67     File = /srv/chroot
68     File = /sys
69     File = /tmp
70     File = /var/cache/apache2/mod_cache_disk
71     File = /var/cache/apt
72     File = /var/lib/apt
73     File = /var/lib/bacula
74     File = /var/lib/munin-async
75     File = /var/lock
76     File = /var/log/samhain
77     File = /var/run
78     File = "\\|bash -c 'grep -s -v ^# /etc/bacula/local-exclude || true'"
79   }
80 }
81
82 ########################################################################
83 # A fileset for the catalog, one sql dump of the db                    #
84 ########################################################################
85 FileSet {
86   Name = "Catalog"
87   Include {
88     Options {
89       signature = SHA1
90       #compression = GZIP9
91     }
92     File = "/var/lib/bacula/bacula.sql.gz"
93   }
94 }
95
96 ########################################################################
97 # The job schedules                                                    #
98 ########################################################################
99
100 # When to do the backups, full backup on first sunday of the month,
101 #  differential (i.e. incremental since full) every other sunday,
102 #  and incremental backups other days
103 Schedule {
104   Name = "WeeklyCycle"
105   # fulls are automatically run if the last full backup was 40 days ago
106   # for the current value of 40 look for "Max Full Interval" in this file.
107   # Run = Full 1st sat at 00:35
108   Run = Differential sat at 00:35
109   Run = Incremental sun-fri at 00:35
110 }
111
112 # This schedule does the catalog. It starts after the WeeklyCycle
113 Schedule {
114   Name = "WeeklyCycleAfterBackup"
115   Run = Full sun-sat at 02:10
116 }
117
118 ########################################################################
119 # Generic catalog service                                              #
120 ########################################################################
121 Catalog {
122   Name = MyCatalog
123   dbname = "service = bacula";
124   #DB Address = "<%= @bacula_db_address %>";
125   #DB Port = <%= @bacula_db_port %>;
126   dbuser = "bacula";
127   dbpassword = "<%= @bacula_db_secret %>"
128 }
129
130 ########################################################################
131 # Message delivery                                                     #
132 ########################################################################
133 Messages {
134   Name = Standard
135   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
136   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
137   #mail on error = <%= @bacula_operator_email %> = all, !skipped
138   mail = <%= @bacula_operator_email %> = all
139   operator = <%= @bacula_operator_email %> = mount
140   console = all, !skipped, !saved
141   append = "/var/lib/bacula/log" = all
142   catalog = all
143 }
144
145 # Message delivery for daemon messages (no job).
146 Messages {
147   Name = Daemon
148   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
149   mail = <%= @bacula_operator_email %> = all
150   console = all, !skipped, !saved
151   append = "/var/lib/bacula/log" = all
152 }
153
154 ########################################################################
155 # Console, limited                                                     #
156 ########################################################################
157 Console {
158   Name = <%= @bacula_monitor_name %>
159   Password = "<%= @bacula_monitor_secret %>"
160   CommandACL = status, .status
161 }
162
163 ########################################################################
164 # Jobdefinitions with defaults and stuff                               #
165 ########################################################################
166 JobDefs {
167   Name = "Standardbackup"
168   Type = Backup
169   Level = Incremental
170   FileSet = "Standard Set"
171   Accurate = yes
172   Schedule = "WeeklyCycle"
173   Messages = Standard
174   Max Full Interval = 40 days
175   Priority = 10
176   Write Bootstrap = "/var/lib/bacula/%c.bsr"
177   Maximum Concurrent Jobs = 20
178   Client Run After Job = "/usr/local/sbin/postbaculajob -c \"%c\" -d \"%d\" -i \"%i\" -l \"%l\" -n \"%n\" -o /var/log/bacula/client-after.state"
179 }
180
181 ########################################################################
182 # Standard Restore template, to be changed by Console program          #
183 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
184 ########################################################################
185 Job {
186   Name = "RestoreFiles"
187   Type = Restore
188   Client = <%=@bacula_director_address%>-fd
189   FileSet = "Standard Set"
190   Pool = poolfull-<%=@bacula_pool_name%>-<%=@bacula_director_address%>
191   Messages = Standard
192   Where = /var/tmp/bacula-restores
193 }
194
195
196 # Scratch pool definition
197 Pool {
198   Name = Scratch
199   Pool Type = Backup
200 }
201
202 ########################################################################
203 # Generic jobs                                                         #
204 ########################################################################
205 # Backup the catalog database (after the nightly save)
206 Storage {
207   Name = "<%= @bacula_filestor_name %>-catalog"
208   Address = <%= @bacula_storage_address %>
209   SDPort = <%= @bacula_storage_port %>
210   Password = "<%= @bacula_storage_secret %>"
211   Device = "<%= @bacula_filestor_device %>-catalog"
212   Media Type = "<%= @bacula_filestor_name %>-catalog"
213   Maximum Concurrent Jobs = 10
214
215   TLS Enable = yes
216   TLS Require = yes
217   TLS CA Certificate File = "<%= @bacula_ca_path %>"
218   # This is a client certificate, used by the director to connect to the storage daemon
219   TLS Certificate = "<%= @bacula_ssl_client_cert %>"
220   TLS Key = "<%= @bacula_ssl_client_key %>"
221 }
222 Pool {
223   Name = "poolcatalog-<%=@bacula_pool_name%>"
224   Pool Type = Backup
225   Storage = "<%=@bacula_filestor_name%>-catalog"
226   AutoPrune = yes
227   Volume Retention = 2 months
228   Label Format = "<%= @bacula_pool_name %>-catalog.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
229   Volume Use Duration = 23h
230   Maximum Volume Jobs = 1
231   Maximum Volume Bytes = 500G
232   Action On Purge = Truncate
233   Recycle = yes
234   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
235 }
236 Pool {
237   Name = "poolcataloggraveyard-<%=@bacula_pool_name%>"
238   Pool Type = Backup
239   Storage = "<%=@bacula_filestor_name%>-catalog"
240   Recycle = yes
241   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
242 }
243
244 Job {
245   Name = "BackupCatalog"
246   JobDefs = "Standardbackup"
247   Client = <%=@bacula_director_address%>-fd
248   Level = Full
249   FileSet = "Catalog"
250   Schedule = "WeeklyCycleAfterBackup"
251 #  # This creates an ASCII copy of the catalog
252 #  # Arguments to make_catalog_backup.pl are:
253 #  #  make_catalog_backup.pl <catalog-name>
254   RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
255 #  # This deletes the copy of the catalog
256   RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
257   Write Bootstrap = "/var/lib/bacula/%n.bsr"
258   Priority = 15    # run after main backup
259   Pool = "poolcatalog-<%=@bacula_pool_name%>"
260 }
261
262 ########################################################################
263 # And now include all the generated configs                            #
264 ########################################################################
265 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"