Skip to content

Commit

Permalink
systemtests: added backup-bareos-passive-test
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Mar 6, 2019
1 parent 925cfa2 commit 374ee4d
Show file tree
Hide file tree
Showing 43 changed files with 534 additions and 17 deletions.
1 change: 1 addition & 0 deletions systemtests/CMakeLists.txt
Expand Up @@ -158,6 +158,7 @@ endforeach()
set(tests_dir ${PROJECT_BINARY_DIR}/tests)
set(SYSTEM_TESTS
backup-bareos-test
backup-bareos-passive-test
)

set(BASEPORT 42001)
Expand Down
2 changes: 1 addition & 1 deletion systemtests/tests/TODO.txt
Expand Up @@ -6,6 +6,7 @@ tests ported to systemtests:
----------------------------

disk:backup-bareos-test
disk:backup-bareos-passive-test

Tests to be ported:
------------------
Expand All @@ -31,7 +32,6 @@ disk:allowed-scriptdir-test
disk:always-incremental-test
disk:auto-label-test
disk:backup-bareos-client-initiated-connection-test
disk:backup-bareos-passive-test
disk:backup-to-null
disk:bandwidth-limit-per-client-test
disk:base-job-test
Expand Down
@@ -0,0 +1,8 @@
Catalog {
Name = MyCatalog
#dbdriver = "@DEFAULT_DB_TYPE@"
dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX"
dbname = "@db_name@"
dbuser = "@db_user@"
dbpassword = "@db_password@"
}
@@ -0,0 +1,8 @@
Client {
Name = bareos-fd
Description = "Client resource of the Director itself."
Address = localhost
Password = "@fd_password@" # password for FileDaemon
FD PORT = @fd_port@
Passive = yes
}
@@ -0,0 +1,7 @@
Console {
Name = bareos-mon
Description = "Restricted console used by tray-monitor to get the status of the director."
Password = "@mon_dir_password@"
CommandACL = status, .status
JobACL = *all*
}
@@ -0,0 +1,27 @@
Director { # define myself
Name = bareos-dir
QueryFile = "@scriptdir@/query.sql"
Maximum Concurrent Jobs = 10
Password = "@dir_password@" # Console password
Messages = Daemon
Auditing = yes

# Enable the Heartbeat if you experience connection losses
# (eg. because of your router or firewall configuration).
# Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd.
#
# Heartbeat Interval = 1 min

# remove comment in next line to load dynamic backends from specified directory
Backend Directory = @backenddir@

# remove comment from "Plugin Directory" to load plugins from specified directory.
# if "Plugin Names" is defined, only the specified plugins will be loaded,
# otherwise all director plugins (*-dir.so) from the "Plugin Directory".
#
# Plugin Directory = "@plugindir@"
# Plugin Names = ""
Working Directory = "@working_dir@"
Pid Directory = "@working_dir@"
DirPort = @dir_port@
}
@@ -0,0 +1,11 @@
FileSet {
Name = "Catalog"
Description = "Backup the catalog dump and Bareos configuration files."
Include {
Options {
signature = MD5
}
File = "/var/lib/bareos/bareos.sql" # database dump
File = "/usr/local/etc/bareos" # configuration
}
}
@@ -0,0 +1,11 @@
FileSet {
Name = "Catalog"
Description = "Backup the catalog dump and Bareos configuration files."
Include {
Options {
signature = MD5
}
File = "@working_dir@/@db_name@.sql" # database dump
File = "@confdir@" # configuration
}
}
@@ -0,0 +1,31 @@
FileSet {
Name = "LinuxAll"
Description = "Backup all regular filesystems, determined by filesystem type."
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
One FS = No # change into other filessytems
FS Type = btrfs
FS Type = ext2 # filesystems of given types will be backed up
FS Type = ext3 # others will be ignored
FS Type = ext4
FS Type = reiserfs
FS Type = jfs
FS Type = xfs
FS Type = zfs
}
File = /
}
# Things that usually have to be excluded
# You have to exclude /var/lib/bareos/storage
# on your bareos server
Exclude {
File = /var/lib/bareos
File = /var/lib/bareos/storage
File = /proc
File = /tmp
File = /var/tmp
File = /.journal
File = /.fsck
}
}
@@ -0,0 +1,31 @@
FileSet {
Name = "LinuxAll"
Description = "Backup all regular filesystems, determined by filesystem type."
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
One FS = No # change into other filessytems
FS Type = btrfs
FS Type = ext2 # filesystems of given types will be backed up
FS Type = ext3 # others will be ignored
FS Type = ext4
FS Type = reiserfs
FS Type = jfs
FS Type = xfs
FS Type = zfs
}
File = /
}
# Things that usually have to be excluded
# You have to exclude @archivedir@
# on your bareos server
Exclude {
File = @working_dir@
File = @archivedir@
File = /proc
File = /tmp
File = /var/tmp
File = /.journal
File = /.fsck
}
}
@@ -0,0 +1,11 @@
FileSet {
Name = "SelfTest"
Description = "fileset just to backup some files for selftest"
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
}
#File = "/usr/local/sbin"
File=</file-list
}
}
@@ -0,0 +1,11 @@
FileSet {
Name = "SelfTest"
Description = "fileset just to backup some files for selftest"
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
}
#File = "@sbindir@"
File=<@tmpdir@/file-list
}
}
@@ -0,0 +1,17 @@
FileSet {
Name = "Windows All Drives"
Enable VSS = yes
Include {
Options {
Signature = MD5
Drive Type = fixed
IgnoreCase = yes
WildFile = "[A-Z]:/pagefile.sys"
WildDir = "[A-Z]:/RECYCLER"
WildDir = "[A-Z]:/$RECYCLE.BIN"
WildDir = "[A-Z]:/System Volume Information"
Exclude = yes
}
File = /
}
}
@@ -0,0 +1,21 @@
Job {
Name = "BackupCatalog"
Description = "Backup the catalog database (after the nightly save)"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"

# This creates an ASCII copy of the catalog
# Arguments to make_catalog_backup.pl are:
# make_catalog_backup.pl <catalog-name>
RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog"

# This deletes the copy of the catalog
RunAfterJob = "@scriptdir@/delete_catalog_backup"

# This sends the bootstrap via mail for disaster recovery.
# Should be sent to another system, please change recipient accordingly
Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01)
Priority = 11 # run after main backup
}
@@ -0,0 +1,11 @@
Job {
Name = "RestoreFiles"
Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..."
Type = Restore
Client = bareos-fd
FileSet = "LinuxAll"
Storage = File
Pool = Incremental
Messages = Standard
Where = /tmp/bareos-restores
}
@@ -0,0 +1,5 @@
Job {
Name = "backup-bareos-fd"
JobDefs = "DefaultJob"
Client = "bareos-fd"
}
@@ -0,0 +1,16 @@
JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = bareos-fd
FileSet = "SelfTest" # selftest fileset (#13)
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = Incremental
Priority = 10
Write Bootstrap = "@working_dir@/%c.bsr"
Full Backup Pool = Full # write Full Backups into "Full" Pool (#05)
Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08)
Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11)
}
@@ -0,0 +1,9 @@
Messages {
Name = Daemon
Description = "Message delivery for daemon messages (no job)."
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r"
mail = @job_email@ = all, !skipped, !audit # (#02)
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !audit
append = "@logdir@/bareos-audit.log" = audit
}
@@ -0,0 +1,11 @@
Messages {
Name = Standard
Description = "Reasonable message delivery -- send most everything to email address and to the console."
operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r"
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r"
operator = @job_email@ = mount # (#03)
mail = @job_email@ = all, !skipped, !saved, !audit # (#02)
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit
catalog = all, !skipped, !saved, !audit
}
@@ -0,0 +1,10 @@
Pool {
Name = Differential
Pool Type = Backup
Recycle = yes # Bareos can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 90 days # How long should the Differential Backups be kept? (#09)
Maximum Volume Bytes = 10G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Differential-" # Volumes will be labeled "Differential-<volume-id>"
}
@@ -0,0 +1,10 @@
Pool {
Name = Full
Pool Type = Backup
Recycle = yes # Bareos can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # How long should the Full Backups be kept? (#06)
Maximum Volume Bytes = 50G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Full-" # Volumes will be labeled "Full-<volume-id>"
}
@@ -0,0 +1,10 @@
Pool {
Name = Incremental
Pool Type = Backup
Recycle = yes # Bareos can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12)
Maximum Volume Bytes = 1G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Incremental-" # Volumes will be labeled "Incremental-<volume-id>"
}
@@ -0,0 +1,4 @@
Pool {
Name = Scratch
Pool Type = Scratch
}
@@ -0,0 +1,18 @@
Profile {
Name = operator
Description = "Profile allowing normal Bareos operations."

Command ACL = !.bvfs_clear_cache, !.exit, !.sql
Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount
Command ACL = *all*

Catalog ACL = *all*
Client ACL = *all*
FileSet ACL = *all*
Job ACL = *all*
Plugin Options ACL = *all*
Pool ACL = *all*
Schedule ACL = *all*
Storage ACL = *all*
Where ACL = *all*
}
@@ -0,0 +1,6 @@
Schedule {
Name = "WeeklyCycle"
Run = Full 1st sat at 21:00 # (#04)
Run = Differential 2nd-5th sat at 21:00 # (#07)
Run = Incremental mon-fri at 21:00 # (#10)
}
@@ -0,0 +1,5 @@
Schedule {
Name = "WeeklyCycleAfterBackup"
Description = "This schedule does the catalog. It starts after the WeeklyCycle."
Run = Full mon-fri at 21:10
}
@@ -0,0 +1,8 @@
Storage {
Name = File
Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here).
Password = "@sd_password@"
Device = FileStorage
Media Type = File
SD Port = @sd_port@
}
@@ -0,0 +1,20 @@
Client {
Name = @basename@-fd
Maximum Concurrent Jobs = 20

# remove comment from "Plugin Directory" to load plugins from specified directory.
# if "Plugin Names" is defined, only the specified plugins will be loaded,
# otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory".
#
# Plugin Directory = "@plugindir@"
# Plugin Names = ""

# if compatible is set to yes, we are compatible with bacula
# if set to no, new bareos features are enabled which is the default
# compatible = yes

Working Directory = "@working_dir@"
Pid Directory = "@working_dir@"
FD Port = @fd_port@

}
@@ -0,0 +1,5 @@
Director {
Name = bareos-dir
Password = "@fd_password@"
Description = "Allow the configured Director to access this file daemon."
}
@@ -0,0 +1,6 @@
Director {
Name = bareos-mon
Password = "@mon_fd_password@"
Monitor = yes
Description = "Restricted Director, used by tray-monitor to get the status of this file daemon."
}

0 comments on commit 374ee4d

Please sign in to comment.