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