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