Drop old WeeklyCycle, rename the daily WeeklyCycleAfterBackup schedule to CatalogSchedule
[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 = "/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   Heartbeat Interval = 60
37 }
38
39 ########################################################################
40 # Standard Fileset                                                     #
41 ########################################################################
42 FileSet {
43   Name = "Standard Set"
44   Ignore FileSet Changes = yes
45   Include {
46     Options {
47       signature = SHA1
48       compression = GZIP9
49       aclsupport = yes
50       xattrsupport = yes
51     }
52     Options {
53       wild = "/swapfile*"
54       exclude = yes
55     }
56     File = "\\|/usr/local/sbin/bacula-backup-dirs"
57     # Dont backup directories that contain .nobackup files
58     Exclude Dir Containing = .nobackup
59   }
60
61   Exclude {
62     File = /.fsck
63     File = /.journal
64     File = /dev
65     File = /home/buildd/build-trees
66     File = /lib/init/rw
67     File = /nonexistant
68     File = /proc
69     File = /srv/chroot
70     File = /sys
71     File = /tmp
72     File = /srv/apache-cache/mod_cache_disk
73     File = /var/cache/apache2/mod_cache_disk
74     File = /var/cache/apt
75     File = /var/lib/apt
76     File = /var/lib/bacula
77     File = /var/lib/munin-async
78     File = /var/lock
79     File = /var/log/samhain
80     File = /var/run
81     File = "\\|bash -c 'grep -s -v ^# /etc/bacula/local-exclude || true'"
82   }
83 }
84
85 ########################################################################
86 # A fileset for the catalog, one sql dump of the db                    #
87 ########################################################################
88 FileSet {
89   Name = "Catalog"
90   Include {
91     Options {
92       signature = SHA1
93     }
94     File = "/var/lib/bacula/bacula.sql.gz"
95   }
96 }
97
98 ########################################################################
99 # The job schedules                                                    #
100 ########################################################################
101
102 # This schedule does the catalog
103 Schedule {
104   Name = "CatalogSchedule"
105   Run = Full sun-sat at 02:10
106 }
107
108 ########################################################################
109 # Generic catalog service                                              #
110 ########################################################################
111 Catalog {
112   Name = MyCatalog
113   dbname = <%= @db_name %>;
114   dbport = <%= @db_port %>;
115   dbaddress = "<%= @db_address %>";
116   dbsslmode = verify-ca;
117 <% if @db_sslca %>
118   dbsslca = "<%= @db_sslca %>";
119 <% end %>
120   dbuser = "<%= @db_user %>";
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   syslog = all
136   append = "/var/lib/bacula/log" = all
137   catalog = all
138 }
139
140 # Message delivery for daemon messages (no job).
141 Messages {
142   Name = Daemon
143   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
144   mail = <%= @bacula_operator_email %> = all
145   console = all, !skipped, !saved
146   syslog = all
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   Messages = Standard
169   Max Full Interval = 50 days
170   Priority = 10
171   Write Bootstrap = "/var/lib/bacula/%c.bsr"
172   Maximum Concurrent Jobs = 20
173   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"
174 }
175
176 ########################################################################
177 # Standard Restore template, to be changed by Console program          #
178 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
179 ########################################################################
180 Job {
181   Name = "RestoreFiles"
182   Type = Restore
183   Client = <%=@bacula_director_address%>-fd
184   FileSet = "Standard Set"
185   Pool = poolfull-<%=@bacula_pool_name%>-<%=@bacula_director_address%>
186   Messages = Standard
187   Where = /var/tmp/bacula-restores
188 }
189
190
191 # Scratch pool definition
192 Pool {
193   Name = Scratch
194   Pool Type = Backup
195 }
196
197 ########################################################################
198 # Generic jobs                                                         #
199 ########################################################################
200 # Backup the catalog database (after the nightly save)
201 Storage {
202   Name = "<%= @bacula_filestor_name %>-catalog"
203   Address = <%= @bacula_storage_address %>
204   SDPort = <%= @bacula_storage_port %>
205   Password = "<%= @bacula_storage_secret %>"
206   Device = "<%= @bacula_filestor_device %>-catalog"
207   Media Type = "<%= @bacula_filestor_name %>-catalog"
208   Maximum Concurrent Jobs = 10
209
210   TLS Enable = yes
211   TLS Require = yes
212   TLS CA Certificate File = "<%= @bacula_ca_path %>"
213   # This is a client certificate, used by the director to connect to the storage daemon
214   TLS Certificate = "<%= @bacula_ssl_client_cert %>"
215   TLS Key = "<%= @bacula_ssl_client_key %>"
216 }
217 Pool {
218   Name = "poolcatalog-<%=@bacula_pool_name%>"
219   Pool Type = Backup
220   Storage = "<%=@bacula_filestor_name%>-catalog"
221   AutoPrune = yes
222   Volume Retention = 2 months
223   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}"
224   Volume Use Duration = 23h
225   Maximum Volume Jobs = 1
226   Maximum Volume Bytes = 500G
227   Action On Purge = Truncate
228   Recycle = yes
229   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
230 }
231 Pool {
232   Name = "poolcataloggraveyard-<%=@bacula_pool_name%>"
233   Pool Type = Backup
234   Storage = "<%=@bacula_filestor_name%>-catalog"
235   Recycle = yes
236   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
237 }
238
239 Job {
240   Name = "BackupCatalog"
241   JobDefs = "Standardbackup"
242   Client = <%=@bacula_director_address%>-fd
243   Level = Full
244   FileSet = "Catalog"
245   Schedule = "CatalogSchedule"
246 #  # This creates an ASCII copy of the catalog
247 #  # Arguments to make_catalog_backup.pl are:
248 #  #  make_catalog_backup.pl <catalog-name>
249   RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
250 #  # This deletes the copy of the catalog
251   RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
252   Write Bootstrap = "/var/lib/bacula/%n.bsr"
253   Priority = 15    # run after main backup
254   Pool = "poolcatalog-<%=@bacula_pool_name%>"
255 }
256
257 ########################################################################
258 # And now include all the generated configs                            #
259 ########################################################################
260 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"