]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/templates/bacula-dir.conf.erb
7c568350d43a47cabea547928104c48f4e34bf14
[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 = "\\|bash -c \"df -Pkl -x tmpfs -x iso9660 | tail -n +2 | awk '{print \$NF}' \""
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 = /proc
57     File = /tmp
58     File = /.journal
59     File = /.fsck
60     File = /sys
61     File = /lib/init/rw
62     File = /var/run
63     File = /var/lock
64     File = /dev
65     File = /srv/chroot
66     File = /home/buildd/build-trees
67   }
68 }
69
70 ########################################################################
71 # A fileset for the catalog, one sql dump of the db                    #
72 ########################################################################
73 FileSet {
74   Name = "Catalog"
75   Include {
76     Options {
77       signature = SHA1
78       compression = GZIP9
79     }
80     File = "/var/lib/bacula/bacula.sql"
81   }
82 }
83
84 ########################################################################
85 # The job schedules                                                    #
86 ########################################################################
87
88 # When to do the backups, full backup on first sunday of the month,
89 #  differential (i.e. incremental since full) every other sunday,
90 #  and incremental backups other days
91 Schedule {
92   Name = "WeeklyCycle"
93   Run = Full 1st sat at 00:35
94   Run = Differential 2nd-5th sat at 00:35
95   Run = Incremental sun-fri at 00:35
96 }
97
98 # This schedule does the catalog. It starts after the WeeklyCycle
99 Schedule {
100   Name = "WeeklyCycleAfterBackup"
101   Run = Full sun-sat at 02:10
102 }
103
104 ########################################################################
105 # Generic catalog service                                              #
106 ########################################################################
107 Catalog {
108   Name = MyCatalog
109   dbname = "service = bacula";
110   #DB Address = "<%= bacula_db_address %>";
111   #DB Port = <%= bacula_db_port %>;
112   dbuser = "bacula";
113   dbpassword = "<%= bacula_db_secret %>"
114 }
115
116 ########################################################################
117 # Message delivery                                                     #
118 ########################################################################
119 Messages {
120   Name = Standard
121   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
122   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
123   #mail on error = <%= bacula_operator_email %> = all, !skipped
124   mail = <%= bacula_operator_email %> = all, !skipped
125   operator = <%= bacula_operator_email %> = mount
126   console = all, !skipped, !saved
127   append = "/var/lib/bacula/log" = all, !skipped
128   catalog = all
129 }
130
131 # Message delivery for daemon messages (no job).
132 Messages {
133   Name = Daemon
134   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
135   mail = <%= bacula_operator_email %> = all, !skipped
136   console = all, !skipped, !saved
137   append = "/var/lib/bacula/log" = all, !skipped
138 }
139
140 ########################################################################
141 # Console, limited                                                     #
142 ########################################################################
143 Console {
144   Name = <%= bacula_monitor_name %>
145   Password = "<%= bacula_monitor_secret %>"
146   CommandACL = status, .status
147 }
148
149 ########################################################################
150 # Jobdefinitions with defaults and stuff                               #
151 ########################################################################
152 JobDefs {
153   Name = "Standardbackup"
154   Type = Backup
155   Level = Incremental
156   FileSet = "Standard Set"
157   Schedule = "WeeklyCycle"
158   Messages = Standard
159   Max Full Interval = 1 month
160   Priority = 10
161   Write Bootstrap = "/var/lib/bacula/%c.bsr"
162   Maximum Concurrent Jobs = 20
163   Client Run After Job = "/usr/local/sbin/postbaculajob -c \"%c\" -d \"%d\" -i \"%i\" -l \"%l\" -n \"%n\" -o /var/log/bacula-main.log"
164 }
165
166 ########################################################################
167 # Standard Restore template, to be changed by Console program          #
168 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
169 ########################################################################
170 Job {
171   Name = "RestoreFiles"
172   Type = Restore
173   Client = <%=bacula_director_address%>-fd
174   FileSet = "Standard Set"
175   Pool = poolfull-<%=bacula_pool_name%>-<%=bacula_director_address%>
176   Messages = Standard
177   Where = /var/tmp/bacula-restores
178 }
179
180
181 # Scratch pool definition
182 Pool {
183   Name = Scratch
184   Pool Type = Backup
185 }
186
187 ########################################################################
188 # Generic jobs                                                         #
189 ########################################################################
190 # Backup the catalog database (after the nightly save)
191 #Job {
192 #  Name = "BackupCatalog"
193 #  JobDefs = "Standardbackup"
194 #  Level = Full
195 #  FileSet="Catalog"
196 #  Schedule = "WeeklyCycleAfterBackup"
197 #  # This creates an ASCII copy of the catalog
198 #  # Arguments to make_catalog_backup.pl are:
199 #  #  make_catalog_backup.pl <catalog-name>
200 #  RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
201 #  # This deletes the copy of the catalog
202 #  RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
203 #  Write Bootstrap = "/var/lib/bacula/%n.bsr"
204 #  Priority = 15    # run after main backup
205 #  RunScript {
206 #        RunsWhen=After
207 #           RunsOnClient=No
208 #           Console = "purge volume action=all allpools storage=File"
209 #  }
210 #}
211
212 ########################################################################
213 # And now include all the generated configs                            #
214 ########################################################################
215 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"