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