summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/bacula-dir/templates/etc/bacula/bacula-dir.conf.j295
1 files changed, 95 insertions, 0 deletions
diff --git a/roles/bacula-dir/templates/etc/bacula/bacula-dir.conf.j2 b/roles/bacula-dir/templates/etc/bacula/bacula-dir.conf.j2
index 2042b57..0ab213b 100644
--- a/roles/bacula-dir/templates/etc/bacula/bacula-dir.conf.j2
+++ b/roles/bacula-dir/templates/etc/bacula/bacula-dir.conf.j2
@@ -95,40 +95,55 @@ Job {
FileSet = BaculaHome
Schedule = WeeklyCycle
}
# Backup the mailboxes
{% for h in groups.IMAP | sort %}
Job {
Name = {{ hostvars[h].inventory_hostname_short }}-mailboxes
Client = {{ hostvars[h].inventory_hostname_short }}-fd
JobDefs = DefaultJob
Accurate = no
FileSet = Mailboxes
Pool = mailboxes-inc
Full Backup Pool = mailboxes-full
Schedule = Mailboxes13WeeksCycle
Max Start Delay = 50 min # To avoid too many overlaps
Max Full Interval = 15 weeks
}
{% endfor %}
+# Backup the Nextcloud data
+{% for h in groups.nextcloud | sort %}
+Job {
+ Name = {{ hostvars[h].inventory_hostname_short }}-nextcloud
+ Client = {{ hostvars[h].inventory_hostname_short }}-fd
+ JobDefs = DefaultJob
+ FileSet = NextcloudData
+ Pool = nextcloud-inc
+ Full Backup Pool = nextcloud-full
+ Schedule = Nextcloud13WeeksCycle
+ Max Start Delay = 50 min # To avoid too many overlaps
+ Max Full Interval = 15 weeks
+}
+{% endfor %}
+
# Backup each machine
{% for fd in groups.all | sort %}
Job {
Name = {{ hostvars[fd].inventory_hostname_short }}
Client = {{ hostvars[fd].inventory_hostname_short }}-fd
JobDefs = DefaultJob
FileSet = FileSetRoot
Pool = {{ hostvars[fd].inventory_hostname_short }}
Priority = 15
Schedule = WeeklyCycle
}
{% endfor %}
{% for fd in groups['MDA'] | union(groups['webmail']) | union(groups['lists']) | union(groups['bacula_dir']) | union(groups['nextcloud']) | sort %}
Job {
Name = {{ hostvars[fd].inventory_hostname_short }}-mysql
Client = {{ hostvars[fd].inventory_hostname_short }}-fd
JobDefs = DefaultMySQLJob
}
{% endfor %}
@@ -187,40 +202,76 @@ Schedule {
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 07:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 08:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 09:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 10:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 11:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 12:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 13:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 14:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 15:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 16:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 17:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 18:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 19:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 20:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 21:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 22:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 23:00
Run = Level=Incremental Pool=mailboxes-inc FullPool=mailboxes-full Messages=Quiet mon-sun at 00:00
}
+# Backup Nextcloud data: full backup every 3 months, hourly incremental backup
+Schedule {
+ Name = Nextcloud13WeeksCycle
+ Run = Level=Full Pool=nextcloud-full w04 mon at 02:00
+ Run = Level=Full Pool=nextcloud-full w17 mon at 02:00
+ Run = Level=Full Pool=nextcloud-full w30 mon at 02:00
+ Run = Level=Full Pool=nextcloud-full w43 mon at 02:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 01:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet w05-w16 mon-sun at 02:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet w18-w29 mon-sun at 02:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet w31-w42 mon-sun at 02:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet w44-w03 mon-sun at 02:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 03:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 04:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 05:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 06:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 07:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 08:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 09:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 10:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 11:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 12:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 13:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 14:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 15:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 16:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 17:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 18:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 19:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 20:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 21:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 22:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 23:00
+ Run = Level=Incremental Pool=nextcloud-inc FullPool=nextcloud-full Messages=Quiet mon-sun at 00:00
+}
+
# This schedule does the databases. It starts after the WeeklyCycle
Schedule {
Name = WeeklyCycleAfterBackup
Run = Level=Full Messages=Quiet sun-sat at 01:10
}
# List of files to be backed up
FileSet {
Name = BaculaHome
Include {
Options {
signature = SHA1
compression = GZIP
verify = pins1
noatime = yes
}
File = /var/lib/bacula
}
Exclude {
@@ -350,40 +401,62 @@ FileSet {
}
}
FileSet {
Name = Mailboxes
Include {
Options {
WildDir = /home/mail/attachments/queue
Exclude = yes
}
Options {
signature = SHA1
verify = pins1
}
File = /home/mail/virtual
File = /home/mail/attachments
File = /home/mail/spamspool
}
}
+FileSet {
+ Name = NextcloudData
+ Include {
+ Options {
+ WildFile = "/mnt/nextcloud-data/nextcloud.log"
+ WildFile = "/mnt/nextcloud-data/nextcloud.log.*"
+ WildDir = "/mnt/nextcloud-data/lost+found"
+ WildDir = "/mnt/nextcloud-data/*/cache"
+ WildDir = "/mnt/nextcloud-data/*/files_trashbin"
+ WildDir = "/mnt/nextcloud-data/*/files_versions"
+ WildDir = "/mnt/nextcloud-data/*/preview"
+ WildDir = "/mnt/nextcloud-data/*/uploads"
+ Exclude = yes
+ }
+ Options {
+ signature = SHA1
+ verify = pins1
+ }
+ File = /mnt/nextcloud-data
+ }
+}
+
# Client (File Services) to backup
{% for fd in groups.all | sort %}
Client {
Name = {{ hostvars[fd].inventory_hostname_short }}-fd
Address = {{ ipsec[ hostvars[fd].inventory_hostname_short ] }}
FDPort = 9102
Catalog = MyCatalog
@|"sed -n '/^{{ hostvars[fd].inventory_hostname_short }}-fd\\s/ {s//Password = /p; q}' /etc/bacula/passwords-dir"
File Retention = 4 months
Job Retention = 5 months
AutoPrune = yes
#Maximum Bandwidth = 1mb/s
}
{% endfor %}
# Definition of file storage device
{% for sd in groups['bacula_sd'] | sort %}
Storage {
@@ -434,40 +507,62 @@ Pool {
Name = mailboxes-full
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 26 weeks
Maximum Volume Bytes = 5GB
Label Format = "mailboxes-full-${NumVols:p/4/0/r}"
}
# Mailbox pool definition (inc backup)
Pool {
Name = mailboxes-inc
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 26 weeks
Maximum Volume Bytes = 5GB
Label Format = "mailboxes-inc-${NumVols:p/4/0/r}"
}
+# Nextcloud pool definition (full backup)
+Pool {
+ Name = nextcloud-full
+ Pool Type = Backup
+ Recycle = yes
+ AutoPrune = yes
+ Volume Retention = 26 weeks
+ Maximum Volume Bytes = 5GB
+ Label Format = "nextcloud-full-${NumVols:p/4/0/r}"
+}
+
+# Nextcloud pool definition (inc backup)
+Pool {
+ Name = nextcloud-inc
+ Pool Type = Backup
+ Recycle = yes
+ AutoPrune = yes
+ Volume Retention = 26 weeks
+ Maximum Volume Bytes = 5GB
+ Label Format = "nextcloud-inc-${NumVols:p/4/0/r}"
+}
+
# Database pool definition
Pool {
Name = database
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 3 months
Maximum Volume Bytes = 5GB
Label Format = "database-${NumVols:p/4/0/r}"
}
# Generic catalog service
Catalog {
Name = MyCatalog
Password = ""
DB Name = bacula
User = bacula
}