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