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