1
|
%if %%bareos_db_type == 'mysql'
|
2
|
%if %%adresse_ip_mysql == 'localhost'
|
3
|
%set %%dbaddress = "127.0.0.1"
|
4
|
%else
|
5
|
%set %%dbaddress = "%%adresse_ip_mysql"
|
6
|
%end if
|
7
|
%end if
|
8
|
##############################################################################r
|
9
|
# Directeur #
|
10
|
###############################################################################
|
11
|
|
12
|
Director {
|
13
|
Name = %%bareos_dir_name
|
14
|
DIRport = 9101
|
15
|
QueryFile = "/etc/bareos/query.sql"
|
16
|
WorkingDirectory = "/var/lib/bareos"
|
17
|
PidDirectory = "/var/run/bareos"
|
18
|
Maximum Concurrent Jobs = 1
|
19
|
Heartbeat Interval = 10
|
20
|
Password = "%%bareos_dir_password" # Console password
|
21
|
Messages = MessagesDir
|
22
|
}
|
23
|
|
24
|
Console {
|
25
|
Name = bareos-%%{nom_machine}-mon
|
26
|
Password = %%creole_client.get('bareos.monitor.bareos_mon_password')
|
27
|
CommandACL = status, .status
|
28
|
}
|
29
|
%if %%getVar('activer_bareoswebui', 'non') == 'oui'
|
30
|
%for %%user in %%bareoswebui_user
|
31
|
|
32
|
Console {
|
33
|
Name = "%%user"
|
34
|
Password = "%%user.bareoswebui_password"
|
35
|
CommandACL = cancel, messages, rerun, restore, run, show, status, version
|
36
|
Job ACL = *all*
|
37
|
Schedule ACL = *all*
|
38
|
Catalog ACL = *all*
|
39
|
Pool ACL = *all*
|
40
|
Storage ACL = *all*
|
41
|
Client ACL = *all*
|
42
|
FileSet ACL = *all*
|
43
|
}
|
44
|
%end for
|
45
|
%end if
|
46
|
|
47
|
###############################################################################
|
48
|
# Client local #
|
49
|
###############################################################################
|
50
|
|
51
|
# Le client est toujours disponible pour sauvegarde le catalogue
|
52
|
Client {
|
53
|
Name = %%bareos_fd_name
|
54
|
Address = "127.0.0.1"
|
55
|
FDPort = 9102
|
56
|
Catalog = MyCatalog
|
57
|
Password = "%%bareos_fd_dir_password" # password for FileDaemon
|
58
|
#AutoPrune = yes # Prune expired Jobs/Files
|
59
|
# On garde la liste des fichiers aussi longtemps que nécessaire
|
60
|
# La durée maximale est la rétention des volumes de sauvegarde complet
|
61
|
# ou la retention de base si on n'utilise pas des pool séparés
|
62
|
# File Retention = %%bareos_full_retention %%bareos_full_retention_unit
|
63
|
# Job Retention = %%bareos_full_retention %%bareos_full_retention_unit
|
64
|
}
|
65
|
%if %%activer_bareos_fd_remote == 'oui'
|
66
|
%for %%bareos_fd in %%bareos_fd_remote_name
|
67
|
|
68
|
Client {
|
69
|
Name = %%bareos_fd.bareos_fd_remote_display_name
|
70
|
Address = "%%bareos_fd.bareos_fd_remote_adresse"
|
71
|
FDPort = 9102
|
72
|
Catalog = MyCatalog
|
73
|
Password = "%%bareos_fd.bareos_fd_remote_password" # password for FileDaemon
|
74
|
#AutoPrune = yes # Prune expired Jobs/Files
|
75
|
}
|
76
|
%end for
|
77
|
%end if
|
78
|
|
79
|
###############################################################################
|
80
|
# Schedule #
|
81
|
###############################################################################
|
82
|
|
83
|
Schedule {
|
84
|
Name = "ScheduleDefaultPre"
|
85
|
@/etc/bareos/bareosschedulepre.conf
|
86
|
}
|
87
|
%if %%activer_bareos_fd_local == 'oui'
|
88
|
|
89
|
Schedule {
|
90
|
Name = "ScheduleDefault"
|
91
|
@/etc/bareos/bareosschedule.conf
|
92
|
}
|
93
|
%end if
|
94
|
|
95
|
Schedule {
|
96
|
Name = "ScheduleDefaultPost"
|
97
|
@/etc/bareos/bareosschedulepost.conf
|
98
|
}
|
99
|
%if %%activer_bareos_fd_remote == 'oui'
|
100
|
%for %%bareos_fd in %%bareos_fd_remote_name
|
101
|
|
102
|
Schedule {
|
103
|
Name = "Schedule%%{bareos_fd.bareos_fd_remote_display_name}"
|
104
|
@/etc/bareos/%%{bareos_fd}/bareosschedule.conf
|
105
|
}
|
106
|
%end for
|
107
|
%end if
|
108
|
|
109
|
###############################################################################
|
110
|
# Storage #
|
111
|
###############################################################################
|
112
|
|
113
|
# StorageDescriptor (peut être local ou distant)
|
114
|
Storage {
|
115
|
Name = "%%{nom_machine}-sd"
|
116
|
# Do not use "localhost" here
|
117
|
Address = "%%bareos_sd_adresse"
|
118
|
SDPort = 9103
|
119
|
Password = "%%bareos_sd_password"
|
120
|
Device = FileStorage
|
121
|
Media Type = File
|
122
|
}
|
123
|
|
124
|
###############################################################################
|
125
|
# Job #
|
126
|
###############################################################################
|
127
|
|
128
|
FileSet {
|
129
|
Name = "FileSetDefault"
|
130
|
}
|
131
|
|
132
|
JobDefs {
|
133
|
Name = "JobDefsDefault"
|
134
|
Type = Backup
|
135
|
Level = Full
|
136
|
Client = "%%bareos_fd_name"
|
137
|
Storage = "%%{nom_machine}-sd" #CHANGER LE NOM
|
138
|
Messages = "MessagesDefault"
|
139
|
%if %%bareos_sd_local == 'oui'
|
140
|
# L'option "Mount Command" dans bareos-sd.conf est exécutée à chaque fois donc on mount ici
|
141
|
# https://dev-eole.ac-dijon.fr/issues/8510
|
142
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
143
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
144
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
145
|
%end if
|
146
|
}
|
147
|
%if %%activer_bareos_fd_local == 'oui'
|
148
|
|
149
|
JobDefs {
|
150
|
Name = "JobDefsSauvegarde"
|
151
|
Type = Backup
|
152
|
Storage = "%%{nom_machine}-sd"
|
153
|
Client = "%%bareos_fd_name"
|
154
|
Messages = "MessagesSauvegarde"
|
155
|
Write Bootstrap = "/var/lib/bareos/%%{bareos_dir_name}-JobDefsSauvegarde.bsr"
|
156
|
# Debut Sauvegarde
|
157
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=sauvegarde"
|
158
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=sauvegarde"
|
159
|
# bareosconfig effectue un test de montage, ce test démonte le support donc à effectuer AVANT le montage réel
|
160
|
%if %%bareos_sd_local == 'oui'
|
161
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
162
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
163
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
164
|
%end if
|
165
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=sauvegarde"
|
166
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=sauvegarde"
|
167
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=sauvegarde"
|
168
|
}
|
169
|
|
170
|
# List of files to be backed up
|
171
|
FileSet {
|
172
|
Name = "FileSetSauvegarde"
|
173
|
Exclude {
|
174
|
file = /proc
|
175
|
file = /tmp
|
176
|
file = /.journal
|
177
|
file = /.fsck
|
178
|
}
|
179
|
@|"sh -c 'for f in /etc/bareos/bareosfichiers.d/*.conf; do echo @${f}; done'"
|
180
|
}
|
181
|
%end if
|
182
|
|
183
|
Job {
|
184
|
Name = "JobSchedulePre"
|
185
|
JobDefs = "JobDefsDefault"
|
186
|
Messages = "MessagesDefaultOverwrite"
|
187
|
Schedule = "ScheduleDefaultPre"
|
188
|
FileSet = "FileSetDefault"
|
189
|
Pool = "PoolDefault"
|
190
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=cronpre"
|
191
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=cronpre"
|
192
|
ClientRunBeforeJob = "/usr/share/eole/schedule/schedule_bareos pre"
|
193
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=cronpre"
|
194
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=cronpre"
|
195
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=cronpre"
|
196
|
Priority = 10
|
197
|
Max Wait Time = 600
|
198
|
}
|
199
|
%if %%activer_bareos_fd_local == 'oui'
|
200
|
|
201
|
Job {
|
202
|
Name = "JobSauvegarde"
|
203
|
Schedule = "ScheduleDefault"
|
204
|
FileSet = "FileSetSauvegarde"
|
205
|
JobDefs = "JobDefsSauvegarde"
|
206
|
Pool = "Full-Pool"
|
207
|
Full Backup Pool = "Full-Pool"
|
208
|
Differential Backup Pool = "Diff-Pool"
|
209
|
Incremental Backup Pool = "Inc-Pool"
|
210
|
Priority = 20
|
211
|
Max Run Time = %%bareos_max_run_time
|
212
|
}
|
213
|
%end if
|
214
|
|
215
|
Job {
|
216
|
Name = "JobSchedulePost"
|
217
|
JobDefs = "JobDefsDefault"
|
218
|
Schedule = "ScheduleDefaultPost"
|
219
|
FileSet = "FileSetDefault"
|
220
|
Pool = "PoolDefault"
|
221
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=cronpost"
|
222
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=cronpost"
|
223
|
ClientRunAfterJob = "/usr/share/eole/schedule/schedule_bareos post"
|
224
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=cronpost"
|
225
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=cronpost"
|
226
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=cronpost"
|
227
|
Priority = 99
|
228
|
}
|
229
|
%if %%activer_bareos_fd_remote == 'oui'
|
230
|
%for %%bareos_fd in %%bareos_fd_remote_name
|
231
|
|
232
|
JobDefs {
|
233
|
Name = "JobDefs%%{bareos_fd.bareos_fd_remote_display_name}Default"
|
234
|
Type = Backup
|
235
|
Level = Full
|
236
|
Client = "%%bareos_fd.bareos_fd_remote_display_name"
|
237
|
Storage = "%%{nom_machine}-sd" #CHANGER LE NOM
|
238
|
Messages = "MessagesDefault"
|
239
|
%if %%bareos_sd_local == 'oui'
|
240
|
# L'option "Mount Command" dans bareos-sd.conf est exécutée à chaque fois donc on mount ici
|
241
|
# https://dev-eole.ac-dijon.fr/issues/8510
|
242
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
243
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
244
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
245
|
%end if
|
246
|
}
|
247
|
|
248
|
JobDefs {
|
249
|
Name = "JobDefs%%bareos_fd.bareos_fd_remote_display_name"
|
250
|
Type = Backup
|
251
|
Storage = "%%{nom_machine}-sd"
|
252
|
Client = "%%bareos_fd.bareos_fd_remote_display_name"
|
253
|
Messages = "MessagesSauvegarde"
|
254
|
Write Bootstrap = "/var/lib/bareos/%%{bareos_fd.bareos_fd_remote_display_name}-JobDefsSauvegarde.bsr"
|
255
|
# Debut Sauvegarde
|
256
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=sauvegarde"
|
257
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=sauvegarde"
|
258
|
# bareosconfig effectue un test de montage, ce test démonte le support donc à effectuer AVANT le montage réel
|
259
|
%if %%bareos_sd_local == 'oui'
|
260
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
261
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
262
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
263
|
%end if
|
264
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=sauvegarde"
|
265
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=sauvegarde"
|
266
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=sauvegarde"
|
267
|
}
|
268
|
|
269
|
# List of files to be backed up
|
270
|
FileSet {
|
271
|
Name = "FileSet%%bareos_fd.bareos_fd_remote_display_name"
|
272
|
Exclude {
|
273
|
file = /proc
|
274
|
file = /tmp
|
275
|
file = /.journal
|
276
|
file = /.fsck
|
277
|
}
|
278
|
@|"sh -c 'for f in /etc/bareos/%%{bareos_fd}/bareosfichiers.d/*.conf; do echo @${f}; done'"
|
279
|
}
|
280
|
|
281
|
Job {
|
282
|
Name = "JobSchedule%%{bareos_fd.bareos_fd_remote_display_name}Pre"
|
283
|
JobDefs = "JobDefs%%{bareos_fd.bareos_fd_remote_display_name}Default"
|
284
|
Schedule = "ScheduleDefaultPre"
|
285
|
FileSet = "FileSetDefault"
|
286
|
Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
287
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=cronpre"
|
288
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=cronpre"
|
289
|
ClientRunBeforeJob = "/usr/share/eole/schedule/schedule_bareos pre"
|
290
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=cronpre"
|
291
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=cronpre"
|
292
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=cronpre"
|
293
|
Priority = 11
|
294
|
Max Wait Time = 600
|
295
|
}
|
296
|
|
297
|
Job {
|
298
|
Name = "JobSauvegarde%%bareos_fd.bareos_fd_remote_display_name"
|
299
|
Schedule = "Schedule%%bareos_fd.bareos_fd_remote_display_name"
|
300
|
FileSet = "FileSet%%bareos_fd.bareos_fd_remote_display_name"
|
301
|
JobDefs = "JobDefs%%bareos_fd.bareos_fd_remote_display_name"
|
302
|
Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
303
|
Full Backup Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
304
|
Differential Backup Pool = "Diff-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
305
|
Incremental Backup Pool = "Inc-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
306
|
Priority = 20
|
307
|
Max Run Time = %%bareos_max_run_time
|
308
|
}
|
309
|
|
310
|
Job {
|
311
|
Name = "JobSchedule%%{bareos_fd.bareos_fd_remote_display_name}Post"
|
312
|
JobDefs = "JobDefs%%{bareos_fd.bareos_fd_remote_display_name}Default"
|
313
|
Schedule = "ScheduleDefaultPost"
|
314
|
FileSet = "FileSetDefault"
|
315
|
Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
316
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=cronpost"
|
317
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=cronpost"
|
318
|
ClientRunAfterJob = "/usr/share/eole/schedule/schedule_bareos post"
|
319
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=cronpost"
|
320
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=cronpost"
|
321
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=cronpost"
|
322
|
Priority = 98
|
323
|
}
|
324
|
%end for
|
325
|
%end if
|
326
|
|
327
|
###############################################################################
|
328
|
# Message #
|
329
|
###############################################################################
|
330
|
|
331
|
%if not %%is_empty(%%system_mail_from)
|
332
|
%set adresse_expediteur=%%system_mail_from
|
333
|
%else
|
334
|
%set adresse_expediteur="bareos-" + %%nom_machine + "@" + %%nom_domaine_local
|
335
|
%end if
|
336
|
%set %%mail_error = %%custom_join(%%creole_client.get('/bareos/mail/mail_error'), ',')
|
337
|
%set %%mail_ok = %%custom_join(%%creole_client.get('/bareos/mail/mail_ok'), ',')
|
338
|
|
339
|
Messages {
|
340
|
Name = "MessagesDir"
|
341
|
console = all, !skipped, !saved
|
342
|
syslog = all, !skipped, !saved
|
343
|
}
|
344
|
|
345
|
Messages {
|
346
|
Name = "MessagesSauvegarde"
|
347
|
append = "/var/lib/eole/reports/rapport-bareos.txt" = all, !skipped, !notsaved
|
348
|
console = all, !skipped, !saved
|
349
|
syslog = all, !skipped, !saved
|
350
|
mailcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \'%e : %%numero_etab sauvegarde \"%n\" %%nom_machine.%%nom_domaine_local\' -- %r"
|
351
|
%if %%mail_error != ''
|
352
|
MailOnError = %%mail_error = all
|
353
|
operatorcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \"%e : %%numero_etab sauvegarde %%nom_machine.%%nom_domaine_local\" -- %r"
|
354
|
operator = %%mail_error = mount
|
355
|
%end if
|
356
|
%if %%mail_ok != ''
|
357
|
Mail = %%mail_ok = all
|
358
|
%end if
|
359
|
}
|
360
|
|
361
|
Messages {
|
362
|
Name = "MessagesDefault"
|
363
|
append = "/var/lib/eole/reports/rapport-bareos.txt" = all, !skipped, !notsaved
|
364
|
console = all, !skipped, !saved
|
365
|
syslog = all, !skipped, !saved
|
366
|
mailcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \'%e : %%numero_etab sauvegarde \"%n\" %%nom_machine.%%nom_domaine_local\' -- %r"
|
367
|
%if %%mail_error != '' and %%mail_ok != ''
|
368
|
MailOnError = %%mail_error, %%mail_ok = all
|
369
|
operatorcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \"%e : %%numero_etab sauvegarde %%nom_machine.%%nom_domaine_local\" -- %r"
|
370
|
operator = %%mail_error = mount
|
371
|
%elif %%mail_error != ''
|
372
|
MailOnError = %%mail_error = all
|
373
|
operatorcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \"%e : %%numero_etab sauvegarde %%nom_machine.%%nom_domaine_local\" -- %r"
|
374
|
operator = %%mail_error = mount
|
375
|
%elif %%mail_ok != ''
|
376
|
MailOnError = %%mail_ok = all
|
377
|
%end if
|
378
|
}
|
379
|
|
380
|
# pour l'EAD, le rapport doit être écrasé en PRE backup pour ne contenir que la sauvegarde actuelle (Pre, Sauv, Catalogue, Post)
|
381
|
Messages {
|
382
|
Name = "MessagesDefaultOverwrite"
|
383
|
file = "/var/lib/eole/reports/rapport-bareos.txt" = all, !skipped, !notsaved
|
384
|
console = all, !skipped, !saved
|
385
|
syslog = all, !skipped, !saved
|
386
|
mailcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \'%e : %%numero_etab sauvegarde \"%n\" %%nom_machine.%%nom_domaine_local\' -- %r"
|
387
|
%set %%mail_error = %%custom_join(%%creole_client.get('/bareos/mail/mail_error'), ',')
|
388
|
%set %%mail_ok = %%custom_join(%%creole_client.get('/bareos/mail/mail_ok'), ',')
|
389
|
%if %%mail_error != '' and %%mail_ok != ''
|
390
|
MailOnError = %%mail_error, %%mail_ok = all
|
391
|
operatorcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \"%e : %%numero_etab sauvegarde %%nom_machine.%%nom_domaine_local\" -- %r"
|
392
|
operator = %%mail_error = mount
|
393
|
%elif %%mail_error != ''
|
394
|
MailOnError = %%mail_error = all
|
395
|
operatorcommand = "/usr/bin/mutt -n -e \"set from=%%adresse_expediteur copy=no use_envelope_from=yes send_charset=utf-8\" -s \"%e : %%numero_etab sauvegarde %%nom_machine.%%nom_domaine_local\" -- %r"
|
396
|
operator = %%mail_error = mount
|
397
|
%elif %%mail_ok != ''
|
398
|
MailOnError = %%mail_ok = all
|
399
|
%end if
|
400
|
}
|
401
|
|
402
|
###############################################################################
|
403
|
# Pool #
|
404
|
###############################################################################
|
405
|
|
406
|
# Default pool definition
|
407
|
Pool {
|
408
|
Name = "PoolDefault"
|
409
|
Pool Type = Backup
|
410
|
AutoPrune = yes
|
411
|
Recycle = yes # Bareos can automatically recycle Volumes
|
412
|
Maximum Volume Jobs = 1
|
413
|
Maximum Volumes = 1
|
414
|
# Accept Any Volume = yes # write on any volume in the pool
|
415
|
LabelFormat = "%%{bareos_dir_name}-volume-"
|
416
|
Volume Retention = 1 minutes
|
417
|
Recycle Oldest Volume = yes
|
418
|
Recycle Current Volume = yes
|
419
|
Maximum Volume Bytes = 1 gb
|
420
|
}
|
421
|
%if %%activer_bareos_fd_local == 'oui'
|
422
|
|
423
|
# Pool for full backup
|
424
|
Pool {
|
425
|
Name = Full-Pool
|
426
|
Pool Type = Backup
|
427
|
Recycle = yes
|
428
|
AutoPrune = yes
|
429
|
Volume Retention = %%bareos_full_retention %%bareos_full_retention_unit
|
430
|
# Accept Any Volume = yes # write on any volume in the pool
|
431
|
LabelFormat = "%%{bareos_dir_name}-full-"
|
432
|
Recycle Oldest Volume = yes
|
433
|
# Max volume use is 2gb or 1 unit
|
434
|
Maximum Volume Bytes = 2 gb
|
435
|
Volume Use Duration = 1 %%bareos_full_retention_unit
|
436
|
}
|
437
|
|
438
|
# Pool for Differential backup
|
439
|
Pool {
|
440
|
Name = Diff-Pool
|
441
|
Pool Type = Backup
|
442
|
Recycle = yes
|
443
|
AutoPrune = yes
|
444
|
Volume Retention = %%bareos_diff_retention %%bareos_diff_retention_unit
|
445
|
# Accept Any Volume = yes # write on any volume in the pool
|
446
|
LabelFormat = "%%{bareos_dir_name}-diff-"
|
447
|
Recycle Oldest Volume = yes
|
448
|
# Max volume use is 2gb or 1 unit
|
449
|
Maximum Volume Bytes = 2 gb
|
450
|
Volume Use Duration = 1 %%bareos_diff_retention_unit
|
451
|
}
|
452
|
|
453
|
# Pool for incremental backup
|
454
|
Pool {
|
455
|
Name = Inc-Pool
|
456
|
Pool Type = Backup
|
457
|
Recycle = yes
|
458
|
AutoPrune = yes
|
459
|
Volume Retention = %%bareos_inc_retention %%bareos_inc_retention_unit
|
460
|
# Accept Any Volume = yes # write on any volume in the pool
|
461
|
LabelFormat = "%%{bareos_dir_name}-inc-"
|
462
|
Recycle Oldest Volume = yes
|
463
|
# Max volume use is 2gb or retention -1 (avoid very little volumes)
|
464
|
Maximum Volume Bytes = 2 gb
|
465
|
Volume Use Duration = 1 %%bareos_inc_retention_unit
|
466
|
}
|
467
|
%end if
|
468
|
%if %%activer_bareos_fd_remote == 'oui'
|
469
|
%for %%bareos_fd in %%bareos_fd_remote_name
|
470
|
|
471
|
Pool {
|
472
|
Name = Full-Pool-%%bareos_fd.bareos_fd_remote_display_name
|
473
|
Pool Type = Backup
|
474
|
Recycle = yes
|
475
|
AutoPrune = yes
|
476
|
Volume Retention = %%bareos_full_retention %%bareos_full_retention_unit
|
477
|
# Accept Any Volume = yes # write on any volume in the pool
|
478
|
LabelFormat = "%%{bareos_fd.bareos_fd_remote_display_name}-full-"
|
479
|
Recycle Oldest Volume = yes
|
480
|
# Max volume use is 2gb or 1 unit
|
481
|
Maximum Volume Bytes = 2 gb
|
482
|
Volume Use Duration = 1 %%bareos_full_retention_unit
|
483
|
}
|
484
|
|
485
|
Pool {
|
486
|
Name = Diff-Pool-%%bareos_fd.bareos_fd_remote_display_name
|
487
|
Pool Type = Backup
|
488
|
Recycle = yes
|
489
|
AutoPrune = yes
|
490
|
Volume Retention = %%bareos_diff_retention %%bareos_diff_retention_unit
|
491
|
# Accept Any Volume = yes # write on any volume in the pool
|
492
|
LabelFormat = "%%{bareos_fd.bareos_fd_remote_display_name}-diff-"
|
493
|
Recycle Oldest Volume = yes
|
494
|
# Max volume use is 2gb or 1 unit
|
495
|
Maximum Volume Bytes = 2 gb
|
496
|
Volume Use Duration = 1 %%bareos_diff_retention_unit
|
497
|
}
|
498
|
|
499
|
Pool {
|
500
|
Name = Inc-Pool-%%bareos_fd.bareos_fd_remote_display_name
|
501
|
Pool Type = Backup
|
502
|
Recycle = yes
|
503
|
AutoPrune = yes
|
504
|
Volume Retention = %%bareos_inc_retention %%bareos_inc_retention_unit
|
505
|
# Accept Any Volume = yes # write on any volume in the pool
|
506
|
LabelFormat = "%%{bareos_fd.bareos_fd_remote_display_name}-inc-"
|
507
|
Recycle Oldest Volume = yes
|
508
|
# Max volume use is 2gb or retention -1 (avoid very little volumes)
|
509
|
Maximum Volume Bytes = 2 gb
|
510
|
Volume Use Duration = 1 %%bareos_inc_retention_unit
|
511
|
}
|
512
|
%end for
|
513
|
%end if
|
514
|
|
515
|
###############################################################################
|
516
|
# Catalogue #
|
517
|
###############################################################################
|
518
|
|
519
|
# Generic catalog service
|
520
|
Catalog {
|
521
|
Name = MyCatalog
|
522
|
dbdriver = "%%bareos_db_type"
|
523
|
dbname = "bareos"
|
524
|
user = "bareos"
|
525
|
%if %%bareos_db_type == 'mysql'
|
526
|
dbaddress = "%%dbaddress"
|
527
|
password = "%%bareos_db_mysql_password"
|
528
|
%else
|
529
|
password = ""
|
530
|
%end if
|
531
|
}
|
532
|
|
533
|
### Catalog Bareos ###
|
534
|
### le catalog est sur bareos-dir ###
|
535
|
#
|
536
|
Pool {
|
537
|
Name = "PoolCatalog"
|
538
|
Pool Type = Backup
|
539
|
Recycle = yes # Bareos can automatically recycle Volumes
|
540
|
AutoPrune = no # Prune expired volumes
|
541
|
Volume Retention = 1 seconds
|
542
|
Recycle Current Volume = yes
|
543
|
Maximum Volumes = 1
|
544
|
# Accept Any Volume = yes # write on any volume in the pool
|
545
|
LabelFormat = "%%{bareos_dir_name}-catalog-"
|
546
|
Recycle Oldest Volume = yes
|
547
|
Maximum Volume Bytes = 2 gb
|
548
|
Maximum Volume Jobs = 1
|
549
|
}
|
550
|
|
551
|
JobDefs {
|
552
|
Name = "JobDefsCatalog"
|
553
|
Type = Backup
|
554
|
Storage = "%%{nom_machine}-sd"
|
555
|
Client = "%%bareos_fd_name"
|
556
|
Messages = "MessagesDefault"
|
557
|
Write Bootstrap = "/var/lib/bareos/%%{bareos_dir_name}-JobDefsCatalog.bsr"
|
558
|
# Debut Sauvegarde
|
559
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --daemon=%d --jobID=%i --backup_progress --jobType=catalogue"
|
560
|
ClientRunBeforeJob = "sudo /usr/share/eole/sbin/bareosconfig.py --lock --dir=%D --daemon=%d --jobID=%i --backup_progress --jobType=catalogue"
|
561
|
%if %%bareos_sd_local == 'oui'
|
562
|
# bareosconfig effectue un test de montage, ce test démonte le support donc à effectuer AVANT le montage réel
|
563
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
564
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
565
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
566
|
%end if
|
567
|
%if %%bareos_db_type == 'mysql'
|
568
|
RunBeforeJob = "/usr/share/eole/bareos/make_catalog_backup -n bareos -u bareos -a %%dbaddress -t mysql"
|
569
|
%else
|
570
|
RunBeforeJob = "/usr/share/eole/bareos/make_catalog_backup -n bareos -t sqlite3"
|
571
|
%end if
|
572
|
RunAfterJob = "/usr/share/eole/bareos/delete_catalog_backup"
|
573
|
ClientRunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --dir=%D --daemon=%d --jobID=%i --backup_ok --jobType=catalogue"
|
574
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_ok --jobType=catalogue"
|
575
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=%d --jobID=%i --backup_err --jobType=catalogue"
|
576
|
}
|
577
|
|
578
|
Job {
|
579
|
Name = "BackupCatalog"
|
580
|
JobDefs = "JobDefsCatalog"
|
581
|
FileSet = "FileSetCatalog"
|
582
|
Schedule = "ScheduleDefaultPost"
|
583
|
# Prune Jobs = "yes"
|
584
|
Pool = "PoolCatalog"
|
585
|
Priority = 97
|
586
|
}
|
587
|
|
588
|
FileSet {
|
589
|
Name = "FileSetCatalog"
|
590
|
Include {
|
591
|
Options {
|
592
|
signature = MD5
|
593
|
wildfile = "*.bsr"
|
594
|
regexfile = "^%%bareos_db_extract_dir/bareos.sql"
|
595
|
regexfile = "^/etc/eole/bareos.conf"
|
596
|
}
|
597
|
Options {
|
598
|
exclude = Yes
|
599
|
regexfile = ".*"
|
600
|
regexdir = ".*"
|
601
|
}
|
602
|
File = /var/lib/bareos
|
603
|
File = /etc/eole
|
604
|
File = /etc/eole/config.eol
|
605
|
}
|
606
|
}
|
607
|
|
608
|
###############################################################################
|
609
|
# Restauration #
|
610
|
###############################################################################
|
611
|
|
612
|
%if %%activer_bareos_fd_local == 'oui'
|
613
|
Messages {
|
614
|
Name = "MessagesRestore"
|
615
|
file = "/var/log/bareos/restore.txt" = all, !skipped, !notsaved
|
616
|
console = all, !skipped, !saved
|
617
|
syslog = all, !skipped
|
618
|
}
|
619
|
|
620
|
JobDefs {
|
621
|
Name = "JobDefsRestore"
|
622
|
Type = Restore
|
623
|
Client = %%bareos_fd_name
|
624
|
FileSet="FileSetSauvegarde"
|
625
|
Storage = %%{nom_machine}-sd
|
626
|
Pool = Full-Pool
|
627
|
Full Backup Pool = Full-Pool
|
628
|
Differential Backup Pool = Diff-Pool
|
629
|
Incremental Backup Pool = Inc-Pool
|
630
|
Messages = MessagesRestore
|
631
|
Where = /
|
632
|
%if %%bareos_sd_local == 'oui'
|
633
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
634
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
635
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
636
|
%end if
|
637
|
}
|
638
|
|
639
|
@/etc/bareos/bareos-restore.conf
|
640
|
%end if
|
641
|
%if %%activer_bareos_fd_remote == 'oui'
|
642
|
%for %%bareos_fd in %%bareos_fd_remote_name
|
643
|
JobDefs {
|
644
|
Name = "JobDefsRestore%%bareos_fd.bareos_fd_remote_display_name"
|
645
|
Type = Restore
|
646
|
Client = %%bareos_fd_name
|
647
|
FileSet = "FileSet%%bareos_fd.bareos_fd_remote_display_name"
|
648
|
Storage = %%{nom_machine}-sd
|
649
|
Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
650
|
Full Backup Pool = "Full-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
651
|
Differential Backup Pool = "Diff-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
652
|
Incremental Backup Pool = "Inc-Pool-%%bareos_fd.bareos_fd_remote_display_name"
|
653
|
Messages = MessagesRestore
|
654
|
Where = /
|
655
|
%if %%bareos_sd_local == 'oui'
|
656
|
RunBeforeJob = "sudo /usr/share/eole/sbin/bareosmount.py --mount"
|
657
|
RunAfterJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
658
|
RunAfterFailedJob = "sudo /usr/share/eole/sbin/bareosmount.py --umount"
|
659
|
%end if
|
660
|
}
|
661
|
|
662
|
Job {
|
663
|
Name = "Restore%%bareos_fd.bareos_fd_remote_display_name"
|
664
|
JobDefs = "JobDefsRestore%%bareos_fd.bareos_fd_remote_display_name"
|
665
|
}
|
666
|
|
667
|
%end for
|
668
|
%end if
|