-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scheduler: run jobs without client (copy/migrate)
Fixes #1190: Schedules without a client will not be run A misplaced pointer guard prevents copy or migrate jobs to be run by the scheduler. This commit fixes the bug and adds another unittest that tests if a scheduled copy job runs, hence without client.
- Loading branch information
Showing
21 changed files
with
284 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/catalog/MyCatalog.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Catalog { | ||
Name = MyCatalog | ||
#dbdriver = "postgresql" | ||
dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" | ||
dbname = "regress_backup_bareos_test" | ||
dbuser = "regress" | ||
dbpassword = "" | ||
} |
31 changes: 31 additions & 0 deletions
31
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/client/bareos-fd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Client { | ||
Name = bareos-fd | ||
Description = "Client resource of the Director itself." | ||
Address = localhost | ||
Password = "fd_password" # password for FileDaemon | ||
FD PORT = 42002 | ||
} | ||
|
||
Client { | ||
Name = bareos-fd-duplicate-interface | ||
Description = "Client resource with identical network interface for setdebug testing" | ||
Address = localhost | ||
Password = "fd_password" # password for FileDaemon | ||
FD PORT = 42002 | ||
} | ||
|
||
Client { | ||
Name = bareos-fd2 | ||
Description = "Client for setdebug testing." | ||
Address = 192.168.101.1 | ||
Password = "fd_password" # password for FileDaemon | ||
FD PORT = 42002 | ||
} | ||
|
||
Client { | ||
Name = bareos-fd3 | ||
Description = "Client for setdebug testing." | ||
Address = 192.168.101.1 | ||
Password = "fd_password" # password for FileDaemon | ||
FD PORT = 42003 | ||
} |
7 changes: 7 additions & 0 deletions
7
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/console/bareos-mon.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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* | ||
} |
27 changes: 27 additions & 0 deletions
27
.../src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/director/bareos-dir.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Director { # define myself | ||
Name = bareos-dir | ||
QueryFile = "/tmp/scripts/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 = /tmp/core/src/cats | ||
|
||
# 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 = "/tmp/plugindir" | ||
# Plugin Names = "" | ||
Working Directory = "/tmp/tests/backup-bareos-test/working" | ||
Pid Directory = "/tmp/piddir" | ||
DirPort = 42001 | ||
} |
11 changes: 11 additions & 0 deletions
11
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/fileset/Catalog.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FileSet { | ||
Name = "Catalog" | ||
Description = "Backup the catalog dump and Bareos configuration files." | ||
Include { | ||
Options { | ||
signature = MD5 | ||
} | ||
File = "/tmp/tests/backup-bareos-test/working/regress_backup_bareos_test.sql" # database dump | ||
File = "/tmp/tests/backup-bareos-test/etc/bareos" # configuration | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/fileset/LinuxAll.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 /tmp/tests/backup-bareos-test/storage | ||
# on your bareos server | ||
Exclude { | ||
File = /tmp/tests/backup-bareos-test/working | ||
File = /tmp/tests/backup-bareos-test/storage | ||
File = /proc | ||
File = /tmp | ||
File = /var/tmp | ||
File = /.journal | ||
File = /.fsck | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/fileset/SelfTest.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "/tmp/sbin" | ||
File=</tmp/tests/backup-bareos-test/tmp/file-list | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...sts/configs/scheduler-on-time-noday-noclient/bareos-dir.d/fileset/Windows All Drives.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = / | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/job/backup-bareos-fd.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Job { | ||
Name = "backup-bareos-fd" | ||
JobDefs = "HourlyDefaultJob" | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/jobdefs/DefaultJob.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
JobDefs { | ||
Name = "HourlyDefaultJob" | ||
Type = Copy | ||
Level = Incremental | ||
FileSet = "SelfTest" # selftest fileset (#13) | ||
Schedule = "ScheduleOnTime" | ||
Storage = File | ||
Messages = Standard | ||
Pool = Incremental | ||
Priority = 10 | ||
Write Bootstrap = "/tmp/tests/backup-bareos-test/working/%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) | ||
} | ||
|
9 changes: 9 additions & 0 deletions
9
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/messages/Daemon.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Messages { | ||
Name = Daemon | ||
Description = "Message delivery for daemon messages (no job)." | ||
mailcommand = "/tmp/bin/bsmtp -h smtp_host -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" | ||
mail = root@localhost = all, !skipped, !audit # (#02) | ||
console = all, !skipped, !saved, !audit | ||
append = "/tmp/tests/backup-bareos-test/log/bareos.log" = all, !skipped, !audit | ||
append = "/tmp/tests/backup-bareos-test/log/bareos-audit.log" = audit | ||
} |
11 changes: 11 additions & 0 deletions
11
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/messages/Standard.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Messages { | ||
Name = Standard | ||
Description = "Reasonable message delivery -- send most everything to email address and to the console." | ||
operatorcommand = "/tmp/bin/bsmtp -h smtp_host -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" | ||
mailcommand = "/tmp/bin/bsmtp -h smtp_host -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" | ||
operator = root@localhost = mount # (#03) | ||
mail = root@localhost = all, !skipped, !saved, !audit # (#02) | ||
console = all, !skipped, !saved, !audit | ||
append = "/tmp/tests/backup-bareos-test/log/bareos.log" = all, !skipped, !saved, !audit | ||
catalog = all, !skipped, !saved, !audit | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/pool/Differential.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>" | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/pool/Full.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>" | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/pool/Incremental.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>" | ||
} |
4 changes: 4 additions & 0 deletions
4
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/pool/Scratch.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Pool { | ||
Name = Scratch | ||
Pool Type = Scratch | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/profile/operator.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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* | ||
} |
5 changes: 5 additions & 0 deletions
5
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/schedule/schedule.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Schedule { | ||
Name = "ScheduleOnTime" | ||
Enabled = true | ||
Run = Level=Full at 2:05 | ||
} |
35 changes: 35 additions & 0 deletions
35
core/src/tests/configs/scheduler-on-time-noday-noclient/bareos-dir.d/storage/File.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Storage { | ||
Name = File | ||
Address = localhost | ||
Password = "sd_password" | ||
Device = FileStorage | ||
Media Type = File | ||
SD Port = 42003 | ||
} | ||
|
||
Storage { | ||
Name = File-duplicate-interface | ||
Address = localhost | ||
Password = "sd_password" | ||
Device = FileStorage | ||
Media Type = File | ||
SD Port = 42003 | ||
} | ||
|
||
Storage { | ||
Name = File2 | ||
Address = 192.168.179.1 | ||
Password = "sd_password" | ||
Device = FileStorage | ||
Media Type = File | ||
SD Port = 42003 | ||
} | ||
|
||
Storage { | ||
Name = File3 | ||
Address = 192.168.179.1 | ||
Password = "sd_password" | ||
Device = FileStorage | ||
Media Type = File | ||
SD Port = 42004 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters