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