From 75b2de8dae62ecbe53d0f29e843c773a36e94d62 Mon Sep 17 00:00:00 2001 From: Joerg Steffens Date: Wed, 26 Aug 2020 15:33:38 +0200 Subject: [PATCH] systemtest config-dump: added new test This test checks if configuration data is written correctly by the "show" command. Checks both the modes: normal text, JSON. --- systemtests/CMakeLists.txt | 1 + systemtests/scripts/setup | 2 +- .../bareos-dir-19.2.7-show-verbose.conf.in | 548 +++++++ .../etc/bareos/bareos-dir-19.2.7-xc.conf.in | 287 ++++ .../etc/bareos/bareos-dir-address.conf.in | 11 + .../etc/bareos/bareos-dir-full.conf.in | 1419 +++++++++++++++++ .../config-dump/etc/bareos/bconsole.conf.in | 10 + .../orig/bareos-dir-19.2.7-show-verbose.conf | 547 +++++++ .../etc/orig/bareos-dir-19.2.7-show.conf | 280 ++++ .../etc/orig/bareos-dir-19.2.7-xc.conf | 293 ++++ systemtests/tests/config-dump/testrunner | 171 ++ 11 files changed, 3568 insertions(+), 1 deletion(-) create mode 100644 systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-show-verbose.conf.in create mode 100644 systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-xc.conf.in create mode 100644 systemtests/tests/config-dump/etc/bareos/bareos-dir-address.conf.in create mode 100644 systemtests/tests/config-dump/etc/bareos/bareos-dir-full.conf.in create mode 100644 systemtests/tests/config-dump/etc/bareos/bconsole.conf.in create mode 100644 systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show-verbose.conf create mode 100644 systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show.conf create mode 100644 systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-xc.conf create mode 100755 systemtests/tests/config-dump/testrunner diff --git a/systemtests/CMakeLists.txt b/systemtests/CMakeLists.txt index da1c5676013..303869a80aa 100644 --- a/systemtests/CMakeLists.txt +++ b/systemtests/CMakeLists.txt @@ -641,6 +641,7 @@ endforeach() set(tests_dir ${PROJECT_BINARY_DIR}/tests) set(SYSTEM_TESTS client-initiated + config-dump encrypt-signature encrypt-signature-tls-cert notls diff --git a/systemtests/scripts/setup b/systemtests/scripts/setup index eb5bfcf970e..5c6a2d06ccf 100755 --- a/systemtests/scripts/setup +++ b/systemtests/scripts/setup @@ -6,7 +6,7 @@ sed \ -i \ -e 's/dbdriver =.*/dbdriver = XXX_REPLACE_WITH_DATABASE_DRIVER_XXX/' \ - etc/bareos/bareos-dir.d/catalog/*.conf + etc/bareos/bareos-dir.d/catalog/*.conf 2>/dev/null ${scripts}/bareos-config initialize_database_driver . ${rscripts}/functions diff --git a/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-show-verbose.conf.in b/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-show-verbose.conf.in new file mode 100644 index 00000000000..e9a179d494b --- /dev/null +++ b/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-show-verbose.conf.in @@ -0,0 +1,548 @@ +Director { + Name = "bareos-dir" + Messages = "Daemon" + DirAddresses = { + ipv4 = { + addr = 0.0.0.0 + port = @dir_port@ + } + } + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + BackendDirectory = "@backenddir@" + # Subscriptions = 0 + MaximumConcurrentJobs = 10 + # MaximumConnections = 30 + # MaximumConsoleConnections = 20 + Password = "@dir_password@" + # FdConnectTimeout = 3 minutes + # SdConnectTimeout = 30 minutes + # HeartbeatInterval = 0 + # StatisticsRetention = 5 years 1 months 5 days + # StatisticsCollectInterval = 150 + # OptimizeForSize = yes + # OptimizeForSpeed = no + # OmitDefaults = yes + # NdmpLogLevel = 4 + Auditing = yes + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + Address = "localhost" + # Port = 9102 + Password = "[md5]97a3419152ff86bedac46016e0c97271" + # Catalog = "MyCatalog" + # Passive = no + # ConnectionFromDirectorToClient = yes + # ConnectionFromClientToDirector = no + # Enabled = yes + # HardQuota = 0 + # SoftQuota = 0 + # SoftQuotaGracePeriod = 0 + # StrictQuotas = no + # QuotaIncludeFailedJobs = yes + # FileRetention = 2 months + # JobRetention = 6 months + # HeartbeatInterval = 0 + # AutoPrune = no + # MaximumConcurrentJobs = 1 + # NdmpLogLevel = 4 + # NdmpBlockSize = 63 k + # NdmpUseLmdb = yes + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + # BackupFormat = "Native" + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + WriteBootstrap = "/var/lib/bareos/%c.bsr" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + # BackupFormat = "Native" + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + Client = "bareos-fd" + FileSet = "LinuxAll" + Where = "/tmp/bareos-restores" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + # Type = Backup + # BackupFormat = "Native" + Level = Full + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # Client = "bareos-fd" + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + JobDefs = "DefaultJob" + #WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f "(Bareos) " -s "Bootstrap for Job %j" root" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + Priority = 11 + # AllowMixedPriority = no + run before job = "/usr/lib/bareos/scripts/make_catalog_backup.pl MyCatalog" + run after job = "/usr/lib/bareos/scripts/delete_catalog_backup" + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "backup-bareos-fd" + # Type = Backup + # BackupFormat = "Native" + # Level = Incremental + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + Client = "bareos-fd" + # FileSet = "SelfTest" + # Schedule = "WeeklyCycle" + JobDefs = "DefaultJob" + # WriteBootstrap = "/var/lib/bareos/%c.bsr" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Storage { + Name = "File" + Address = "vagrant" + # Port = 9103 + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" + # AutoChanger = no + # Enabled = yes + # AllowCompression = yes + # HeartbeatInterval = 0 + # CacheStatusInterval = 30 seconds + # MaximumConcurrentJobs = 1 + # MaximumConcurrentReadJobs = 0 + # CollectStatistics = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Catalog { + Name = "MyCatalog" + DbPassword = "@db_password@" + DbUser = "@db_user@" + DbName = "@db_name@" + DbDriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + # MultipleConnections = no + # DisableBatchInsert = no + # Reconnect = no + # ExitOnFatal = no + # MinConnections = 1 + # MaxConnections = 5 + # IncConnections = 1 + # IdleTimeout = 30 + # ValidateTimeout = 120 +} + +Schedule { + Name = "WeeklyCycle" + run = Full 1st Sat at 21:00 + run = Differential 2nd-5th Sat at 21:00 + run = Incremental Mon-Fri at 21:00 + # Enabled = yes +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + run = Full Mon-Fri at 21:10 + # Enabled = yes +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = MD5 + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + Wild Dir = "[A-Z]:/RECYCLER" + Wild Dir = "[A-Z]:/$RECYCLE.BIN" + Wild Dir = "[A-Z]:/System Volume Information" + Wild File = "[A-Z]:/pagefile.sys" + Drive Type = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 + OneFS = No + AclSupport = Yes + XattrSupport = Yes + Fs Type = "btrfs" + Fs Type = "ext2" + Fs Type = "ext3" + Fs Type = "ext4" + Fs Type = "reiserfs" + Fs Type = "jfs" + Fs Type = "xfs" + Fs Type = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +Pool { + Name = "Scratch" + PoolType = Scratch + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + # CatalogFiles = yes + # VolumeRetention = 1 years + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Incremental" + PoolType = Backup + LabelFormat = "Incremental-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 1 g + # CatalogFiles = yes + VolumeRetention = 1 months + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Full" + PoolType = Backup + LabelFormat = "Full-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 50 g + # CatalogFiles = yes + # VolumeRetention = 1 years + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Differential" + PoolType = Backup + LabelFormat = "Differential-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 10 g + # CatalogFiles = yes + VolumeRetention = 3 months + # AutoPrune = yes + # Recycle = yes +} + +Messages { + Name = "Standard" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = all,!saved,!skipped,!audit + append = @logdir@/bareos.log = all,!saved,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!saved,!skipped,!audit + operator = root = mount +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = @logdir@/bareos-audit.log = audit + append = @logdir@/bareos.log = all,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api", ".help", "use", "version", "status", "list", "llist", ".clients", ".jobs", ".filesets", ".pools", ".storages", ".defaults", ".schedule", ".bvfs_lsdirs", ".bvfs_lsfiles", ".bvfs_update", ".bvfs_get_jobids", ".bvfs_versions", ".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "webui-admin" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + CommandACL = "status", ".status" + # UsePamAuthentication = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Console { + Name = "admin" + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + Profile = "webui-admin" + # UsePamAuthentication = no + # TlsAuthenticate = no + TlsEnable = no + # TlsRequire = no + # TlsVerifyPeer = no +} + +#Console { +# Name = "*UserAgent*" +# Description = "root console definition" +# Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + # UsePamAuthentication = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +#} + diff --git a/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-xc.conf.in b/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-xc.conf.in new file mode 100644 index 00000000000..bad96428583 --- /dev/null +++ b/systemtests/tests/config-dump/etc/bareos/bareos-dir-19.2.7-xc.conf.in @@ -0,0 +1,287 @@ +Director { + Name = "bareos-dir" + Messages = "Daemon" + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + BackendDirectory = "@backenddir@" + MaximumConcurrentJobs = 10 + Password = "@dir_password@" + Auditing = yes + DirPort = @dir_port@ +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + Address = "localhost" + Password = "[md5]97a3419152ff86bedac46016e0c97271" +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + WriteBootstrap = "/var/lib/bareos/%c.bsr" + Priority = 10 +} + +Job { + Name = "backup-bareos-fd" + Client = "bareos-fd" + JobDefs = "DefaultJob" +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + Client = "bareos-fd" + FileSet = "LinuxAll" + Where = "/tmp/bareos-restores" +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + Level = Full + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + JobDefs = "DefaultJob" + WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" root" + Priority = 11 + run before job = "/usr/lib/bareos/scripts/make_catalog_backup.pl MyCatalog" + run after job = "/usr/lib/bareos/scripts/delete_catalog_backup" +} + +Storage { + Name = "File" + Address = "vagrant" + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" +} + +Catalog { + Name = "MyCatalog" + DbPassword = "@db_password@" + DbUser = "@db_user@" + DbName = "@db_name@" + DbDriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + run = Full Mon-Fri at 21:10 +} + +Schedule { + Name = "WeeklyCycle" + run = Full 1st Sat at 21:00 + run = Differential 2nd-5th Sat at 21:00 + run = Incremental Mon-Fri at 21:00 +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = MD5 + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + Wild Dir = "[A-Z]:/RECYCLER" + Wild Dir = "[A-Z]:/$RECYCLE.BIN" + Wild Dir = "[A-Z]:/System Volume Information" + Wild File = "[A-Z]:/pagefile.sys" + Drive Type = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 + OneFS = No + AclSupport = Yes + XattrSupport = Yes + Fs Type = "btrfs" + Fs Type = "ext2" + Fs Type = "ext3" + Fs Type = "ext4" + Fs Type = "reiserfs" + Fs Type = "jfs" + Fs Type = "xfs" + Fs Type = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +Pool { + Name = "Scratch" + PoolType = Scratch +} + +Pool { + Name = "Incremental" + PoolType = Backup + LabelFormat = "Incremental-" + MaximumVolumes = 100 + MaximumVolumeBytes = 1 g + VolumeRetention = 1 months + AutoPrune = yes + Recycle = yes +} + +Pool { + Name = "Full" + PoolType = Backup + LabelFormat = "Full-" + MaximumVolumes = 100 + MaximumVolumeBytes = 50 g + VolumeRetention = 1 years + AutoPrune = yes + Recycle = yes +} + +Pool { + Name = "Differential" + PoolType = Backup + LabelFormat = "Differential-" + MaximumVolumes = 100 + MaximumVolumeBytes = 10 g + VolumeRetention = 3 months + AutoPrune = yes + Recycle = yes +} + +Messages { + Name = "Standard" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = all,!saved,!skipped,!audit + append = @logdir@/bareos.log = all,!saved,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!saved,!skipped,!audit + operator = root = mount +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = @logdir@/bareos-audit.log = audit + append = @logdir@/bareos.log = all,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api", ".help", "use", "version", "status", "list", "llist", ".clients", ".jobs", ".filesets", ".pools", ".storages", ".defaults", ".schedule", ".bvfs_lsdirs", ".bvfs_lsfiles", ".bvfs_update", ".bvfs_get_jobids", ".bvfs_versions", ".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "webui-admin" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + CommandACL = "status", ".status" +} + +Console { + Name = "admin" + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + Profile = "webui-admin" + TlsEnable = no +} diff --git a/systemtests/tests/config-dump/etc/bareos/bareos-dir-address.conf.in b/systemtests/tests/config-dump/etc/bareos/bareos-dir-address.conf.in new file mode 100644 index 00000000000..87191f129c4 --- /dev/null +++ b/systemtests/tests/config-dump/etc/bareos/bareos-dir-address.conf.in @@ -0,0 +1,11 @@ +Director { + Name = "bareos-dir" + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + BackendDirectory = "@backenddir@" + MaximumConcurrentJobs = 10 + Password = "@dir_password@" + Auditing = yes + DirPort = @dir_port@ +} diff --git a/systemtests/tests/config-dump/etc/bareos/bareos-dir-full.conf.in b/systemtests/tests/config-dump/etc/bareos/bareos-dir-full.conf.in new file mode 100644 index 00000000000..3619c08c78b --- /dev/null +++ b/systemtests/tests/config-dump/etc/bareos/bareos-dir-full.conf.in @@ -0,0 +1,1419 @@ +Director { + Name = "bareos-dir" + Description = "Long string 1234567890 1234567890 1234567890" + Messages = "Daemon" + DirAddresses = { + ipv4 = { + addr = 0.0.0.0 + port = @dir_port@ + } + } + QueryFile = "@scriptdir@/query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@piddir@" + PluginDirectory = "@tmpdir@" + # PluginNames = + ScriptsDirectory = "@tmpdir@" + BackendDirectory = "@backenddir@" + Subscriptions = 10 + SubSysDirectory = "@tmpdir@" + MaximumConcurrentJobs = 100 + MaximumConnections = 300 + MaximumConsoleConnections = 200 + Password = "@dir_password@" + FdConnectTimeout = 1 minutes + SdConnectTimeout = 3 minutes + HeartbeatInterval = 30 seconds + StatisticsRetention = 1 years 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds + StatisticsCollectInterval = 1500 + VerId = "My Private Version ID" + OptimizeForSize = Yes + # OptimizeForSpeed = No + NdmpSnooping = Yes + NdmpLogLevel = 40 + AbsoluteJobTimeout = 10 + Auditing = Yes + AuditEvents = "item11", "item12" + AuditEvents = "item21", "item22", ".*" + # SecureEraseCommand = + # LogTimestampFormat = + # TlsAuthenticate = No + # TlsEnable = Yes + TlsRequire = Yes + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + # Protocol = Native + # AuthType = None + Address = "localhost" + # LanAddress = + # Port = 9102 + # Username = + Password = "[md5]97a3419152ff86bedac46016e0c97271" + # Catalog = "MyCatalog" + # Passive = No + # ConnectionFromDirectorToClient = Yes + # ConnectionFromClientToDirector = No + # Enabled = Yes + # HardQuota = 0 + # SoftQuota = 0 + # SoftQuotaGracePeriod = 0 + # StrictQuotas = No + # QuotaIncludeFailedJobs = Yes + # FileRetention = 2 months + # JobRetention = 6 months + # HeartbeatInterval = 0 + # AutoPrune = No + # MaximumConcurrentJobs = 1 + # MaximumBandwidthPerJob = 0 + # NdmpLogLevel = 4 + # NdmpBlockSize = 63 k + # NdmpUseLmdb = Yes + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +Client { + Name = "min-fd" + # Description = + # Protocol = Native + # AuthType = None + Address = "localhost" + # LanAddress = + # Port = 9102 + # Username = + Password = "[md5]97a3419152ff86bedac46016e0c97271" + # Catalog = "MyCatalog" + # Passive = No + # ConnectionFromDirectorToClient = Yes + # ConnectionFromClientToDirector = No + # Enabled = Yes + # HardQuota = 0 + # SoftQuota = 0 + # SoftQuotaGracePeriod = 0 + # StrictQuotas = No + # QuotaIncludeFailedJobs = Yes + # FileRetention = 2 months + # JobRetention = 6 months + # HeartbeatInterval = 0 + # AutoPrune = No + # MaximumConcurrentJobs = 1 + # MaximumBandwidthPerJob = 0 + # NdmpLogLevel = 4 + # NdmpBlockSize = 63 k + # NdmpUseLmdb = Yes + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +Client { + Name = "max-fd" + Description = "Client resource of the Director itself." + # Protocol = Native + # AuthType = None + Address = "localhost" + LanAddress = "127.0.0.1" + Port = 19102 + Username = "user" + Password = "[md5]97a3419152ff86bedac46016e0c97271" + Catalog = "MyCatalog" + Passive = Yes + ConnectionFromDirectorToClient = No + ConnectionFromClientToDirector = Yes + Enabled = No + HardQuota = 10 k + SoftQuota = 10 k + SoftQuotaGracePeriod = 1 weeks 2 days + StrictQuotas = Yes + QuotaIncludeFailedJobs = No + FileRetention = 10 months + JobRetention = 11 months + HeartbeatInterval = 10 seconds + AutoPrune = Yes + MaximumConcurrentJobs = 10 + MaximumBandwidthPerJob = 10000 + NdmpLogLevel = 40 + NdmpBlockSize = 163 k + NdmpUseLmdb = No + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +JobDefs { + Name = "DefaultJob" + # Description = + Type = Backup + # Protocol = Native + # BackupFormat = "Native" + Level = Differential + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + # VirtualFullBackupPool = "" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + # NextPool = "" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + # JobToVerify = "" + # Catalog = "" + # JobDefs = "" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + WriteBootstrap = "/var/lib/bareos/%c.bsr" + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "job-min-DefaultJob" + # Description = + # Type = Backup + # Protocol = Native + # BackupFormat = "Native" + # Level = Differential + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # NextPool = "" + # Client = "bareos-fd" + # FileSet = "SelfTest" + # Schedule = "WeeklyCycle" + # JobToVerify = "" + # Catalog = "" + JobDefs = "DefaultJob" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + # WriteBootstrap = + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "job-min" + # Description = + Type = Backup + # Protocol = Native + # BackupFormat = "Native" + # Level = + Messages = "Standard" + Storage = "File" + Pool = "Full" + # FullBackupPool = "" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "" + # DifferentialBackupPool = "" + # NextPool = "" + Client = "bareos-fd" + FileSet = "SelfTest" + # Schedule = "" + # JobToVerify = "" + # Catalog = "" + # JobDefs = "" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + # WriteBootstrap = + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "job-max" + Description = "Description, multiple words ..." + Type = Backup + # Protocol = Native + BackupFormat = "Default is Native, trying different value" + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Full" + FullBackupPool = "Full" + # VirtualFullBackupPool = "" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + # NextPool = "" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + # JobToVerify = "" + # Catalog = "" + JobDefs = "DefaultJob" + Run = "job=job-min level=%l since=\"%s\"", "job=job12" + Run = "job=job21", "job=job22" + # Where = + RegexWhere = "!/olddir/!/newdir/!,/.ini$/.ini.new/" + StripPrefix = "/usr/local1" + StripPrefix = "/usr/local2" + AddPrefix = "/usr" + AddSuffix = ".bak" + Bootstrap = "/tmp/used_for_restore/" + WriteBootstrap = "|/bin/true" + WriteVerifyList = "/tmp/verifylist.txt" + Replace = IfNewer + MaximumBandwidth = 10000 + MaxRunSchedTime = 1 hours + MaxRunTime = 1 hours + FullMaxRuntime = 3 days + IncrementalMaxRuntime = 2 days + DifferentialMaxRuntime = 1 days + MaxWaitTime = 1 hours + MaxStartDelay = 1 hours + MaxFullInterval = 3 weeks + MaxVirtualFullInterval = 4 weeks + MaxDiffInterval = 2 weeks + PrefixLinks = Yes + PruneJobs = Yes + PruneFiles = Yes + PruneVolumes = Yes + PurgeMigrationJob = Yes + Enabled = No + SpoolAttributes = Yes + SpoolData = Yes + SpoolSize = 10 m + RerunFailedLevels = Yes + PreferMountedVolumes = No + MaximumConcurrentJobs = 10 + RescheduleOnError = Yes + RescheduleInterval = 10 minutes + RescheduleTimes = 10 + Priority = 100 + AllowMixedPriority = Yes + WritePartAfterJob = Yes + SelectionPattern = "select * from jobs;" + RunBeforeJob = "/usr/lib/bareos/scripts/make_catalog_backup.pl MyCatalog" + RunAfterJob = "/usr/lib/bareos/scripts/delete_catalog_backup" + RunScript { + Command = "/etc/init.d/apache stop" + RunsWhen = "before" + FailJobOnError = No + } + Accurate = Yes + AllowDuplicateJobs = No + AllowHigherDuplicates = No + CancelLowerLevelDuplicates = Yes + CancelQueuedDuplicates = Yes + CancelRunningDuplicates = Yes + SaveFileHistory = No + FileHistorySize = 10 m + FdPluginOptions = "Option 11", "Option 12" + FdPluginOptions = "Option 21", "Option 22" + SdPluginOptions = "Option 11", "Option 12" + SdPluginOptions = "Option 21", "Option 22" + DirPluginOptions = "Option 11", "Option 12" + DirPluginOptions = "Option 21", "Option 22" + Base = "job-min" + Base = "job-max" + MaxConcurrentCopies = 10 + AlwaysIncremental = Yes + AlwaysIncrementalJobRetention = 10 seconds + AlwaysIncrementalKeepNumber = 10 + AlwaysIncrementalMaxFullAge = 30 seconds + # MaxFullConsolidations = 0 + RunOnIncomingConnectInterval = 30 seconds +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + # Protocol = Native + # BackupFormat = "Native" + # Level = + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + # FullBackupPool = "" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "" + # DifferentialBackupPool = "" + # NextPool = "" + Client = "bareos-fd" + FileSet = "LinuxAll" + # Schedule = "" + # JobToVerify = "" + # Catalog = "" + # JobDefs = "" + # Run = + Where = "/tmp/bareos-restores" + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + # WriteBootstrap = + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + # Type = Backup + # Protocol = Native + # BackupFormat = "Native" + Level = Full + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # NextPool = "" + # Client = "bareos-fd" + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + # JobToVerify = "" + # Catalog = "" + JobDefs = "DefaultJob" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" root" + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + Priority = 11 + # AllowMixedPriority = No + # SelectionPattern = + RunBeforeJob = "/usr/lib/bareos/scripts/make_catalog_backup.pl MyCatalog" + RunAfterJob = "/usr/lib/bareos/scripts/delete_catalog_backup" + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "job-runscripts" + # Description = + # Type = Backup + # Protocol = Native + # BackupFormat = "Native" + # Level = Differential + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # NextPool = "" + # Client = "bareos-fd" + # FileSet = "SelfTest" + # Schedule = "WeeklyCycle" + # JobToVerify = "" + # Catalog = "" + JobDefs = "DefaultJob" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + # WriteBootstrap = + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + RunBeforeJob = "/tmp/RunBeforeJob1.sh" + RunBeforeJob = "/tmp/RunBeforeJob2.sh" + RunAfterJob = "/tmp/RunAfterJob1" + RunAfterJob = "/tmp/RunAfterJob2" + RunScript { + Command = "/tmp/RunScript1.sh" + RunsWhen = "before" + FailJobOnError = No + } + RunScript { + Command = "/tmp/RunScript2.sh" + RunsWhen = "before" + FailJobOnError = No + } + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "job-runscripts-mixed" + # Description = + # Type = Backup + # Protocol = Native + # BackupFormat = "Native" + # Level = Differential + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # VirtualFullBackupPool = "" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # NextPool = "" + # Client = "bareos-fd" + # FileSet = "SelfTest" + # Schedule = "WeeklyCycle" + # JobToVerify = "" + # Catalog = "" + JobDefs = "DefaultJob" + # Run = + # Where = + # RegexWhere = + # StripPrefix = + # AddPrefix = + # AddSuffix = + # Bootstrap = + # WriteBootstrap = + # WriteVerifyList = + # Replace = Always + # MaximumBandwidth = 0 + # MaxRunSchedTime = 0 + # MaxRunTime = 0 + # FullMaxRuntime = 0 + # IncrementalMaxRuntime = 0 + # DifferentialMaxRuntime = 0 + # MaxWaitTime = 0 + # MaxStartDelay = 0 + # MaxFullInterval = 0 + # MaxVirtualFullInterval = 0 + # MaxDiffInterval = 0 + # PrefixLinks = No + # PruneJobs = No + # PruneFiles = No + # PruneVolumes = No + # PurgeMigrationJob = No + # Enabled = Yes + # SpoolAttributes = No + # SpoolData = No + # SpoolSize = 0 + # RerunFailedLevels = No + # PreferMountedVolumes = Yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = No + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = No + # SelectionPattern = + RunBeforeJob = "/tmp/RunBeforeJob1.sh" + RunAfterJob = "/tmp/RunAfterJob2" + RunScript { + Command = "/tmp/RunScript3.sh" + RunsWhen = "before" + FailJobOnError = No + } + RunAfterJob = "/tmp/RunAfterJob4" + RunBeforeJob = "/tmp/RunBeforeJob5.sh" + RunScript { + Command = "/tmp/RunScript6.sh" + RunsWhen = "before" + FailJobOnError = No + } + RunScript { + Command = "/tmp/RunScript7.sh" + RunsWhen = "before" + } + # Accurate = No + # AllowDuplicateJobs = Yes + # AllowHigherDuplicates = Yes + # CancelLowerLevelDuplicates = No + # CancelQueuedDuplicates = No + # CancelRunningDuplicates = No + # SaveFileHistory = Yes + # FileHistorySize = 9 m 549 k 640 + # FdPluginOptions = + # SdPluginOptions = + # DirPluginOptions = + # Base = + # MaxConcurrentCopies = 100 + # AlwaysIncremental = No + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # AlwaysIncrementalMaxFullAge = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Storage { + Name = "File" + # Description = + # Protocol = Native + # AuthType = None + Address = "localhost" + # LanAddress = + # Port = 9103 + # Username = + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" + # AutoChanger = No + # Enabled = Yes + # AllowCompression = Yes + # HeartbeatInterval = 0 + # CacheStatusInterval = 30 seconds + # MaximumConcurrentJobs = 1 + # MaximumConcurrentReadJobs = 0 + # PairedStorage = "" + # MaximumBandwidthPerJob = 0 + # CollectStatistics = No + # NdmpChangerDevice = + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +Catalog { + Name = "MyCatalog" + # Description = + # DbAddress = + # DbPort = 0 + DbPassword = "@db_password@" + DbUser = "@db_user@" + DbName = "@db_name@" + DbDriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + # DbSocket = + # MultipleConnections = No + # DisableBatchInsert = No + # Reconnect = No + # ExitOnFatal = No + # MinConnections = 1 + # MaxConnections = 5 + # IncConnections = 1 + # IdleTimeout = 30 + # ValidateTimeout = 120 +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + Run = Full Mon-Fri at 21:10 + # Enabled = Yes +} + +Schedule { + Name = "WeeklyCycle" + # Description = + Run = Full 1st Sat at 21:00 + Run = Differential 2nd-5th Sat at 21:00 + Run = Incremental Mon-Fri at 21:00 + # Enabled = Yes +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = "MD5" + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + WildDir = "[A-Z]:/RECYCLER" + WildDir = "[A-Z]:/$RECYCLE.BIN" + WildDir = "[A-Z]:/System Volume Information" + WildFile = "[A-Z]:/pagefile.sys" + DriveType = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = "MD5" + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = "MD5" + OneFS = No + AclSupport = Yes + XattrSupport = Yes + FsType = "btrfs" + FsType = "ext2" + FsType = "ext3" + FsType = "ext4" + FsType = "reiserfs" + FsType = "jfs" + FsType = "xfs" + FsType = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = "MD5" + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +FileSet { + Name = "ExtraFileSet" + Description = "fileset that reads information during runtime." + Include { + Options { + Signature = "MD5" + AclSupport = Yes + XattrSupport = Yes + } + File = "/tmp/dir" + File = "\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = debug,abort,fatal,error,warning,info,notsaved,mount,Terminate,restored,security,alert,volmgmt,!saved,!skipped,!audit + append = /tmp/btest/systemtests/tests/config-dump/log/bareos.log = debug,abort,fatal,error,warning,info,notsaved,mount,Terminate,restored,security,alert,volmgmt,!saved,!skipped,!audit + console = debug,abort,fatal,error,warning,info,notsaved,mount,Terminate,restored,security,alert,volmgmt,!saved,!skipped,!audit + mail = root = debug,abort,fatal,error,warning,info,notsaved,mount,Terminate,restored,security,alert,volmgmt,!saved,!skipped,!audit + operator = root = mount,!debug,!abort,!fatal,!error,!warning,!info,!saved,!notsaved,!skipped,!Terminate,!restored,!security,!alert,!volmgmt,!audit +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = /tmp/btest/systemtests/tests/config-dump/log/bareos-audit.log = audit,!debug,!abort,!fatal,!error,!warning,!info,!saved,!notsaved,!skipped,!mount,!Terminate,!restored,!security,!alert,!volmgmt + append = /tmp/btest/systemtests/tests/config-dump/log/bareos.log = debug,abort,fatal,error,warning,info,saved,notsaved,mount,Terminate,restored,security,alert,volmgmt,!skipped,!audit + console = debug,abort,fatal,error,warning,info,notsaved,mount,Terminate,restored,security,alert,volmgmt,!saved,!skipped,!audit + mail = root = debug,abort,fatal,error,warning,info,saved,notsaved,mount,Terminate,restored,security,alert,volmgmt,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + # Description = + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api", ".help", "use", "version", "status", "list", "llist", ".clients", ".jobs", ".filesets", ".pools", ".storages", ".defaults", ".schedule", ".bvfs_lsdirs", ".bvfs_lsfiles", ".bvfs_update", ".bvfs_get_jobids", ".bvfs_versions", ".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + # PluginOptionsACL = +} + +Profile { + Name = "webui-admin" + # Description = + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + # PluginOptionsACL = +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache", "!.exit", "!.sql", "!configure", "!create", "!delete", "!purge", "!prune", "!sqlquery", "!umount", "!unmount", "*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + # ClientACL = + # StorageACL = + # ScheduleACL = + # PoolACL = + CommandACL = "status", ".status" + # FileSetACL = + # CatalogACL = + # WhereACL = + # PluginOptionsACL = + # Profile = + # UsePamAuthentication = No + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +Console { + Name = "admin" + # Description = + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + # JobACL = + # ClientACL = + # StorageACL = + # ScheduleACL = + # PoolACL = + # CommandACL = + # FileSetACL = + # CatalogACL = + # WhereACL = + # PluginOptionsACL = + Profile = "webui-admin" + # UsePamAuthentication = No + # TlsAuthenticate = No + TlsEnable = No + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +} + +# Console { + # Name = "*UserAgent*" + # Description = "root console definition" + # Password = "[md5]19c05ce71554a186e052ee6bfadcde4a" + # JobACL = + # ClientACL = + # StorageACL = + # ScheduleACL = + # PoolACL = + # CommandACL = + # FileSetACL = + # CatalogACL = + # WhereACL = + # PluginOptionsACL = + # Profile = + # UsePamAuthentication = No + # TlsAuthenticate = No + # TlsEnable = Yes + # TlsRequire = No + # TlsCipherList = "" + # TlsDhFile = "" + # TlsVerifyPeer = No + # TlsCaCertificateFile = "" + # TlsCaCertificateDir = "" + # TlsCertificateRevocationList = "" + # TlsCertificate = "" + # TlsKey = "" + # TlsAllowedCn = +# } + diff --git a/systemtests/tests/config-dump/etc/bareos/bconsole.conf.in b/systemtests/tests/config-dump/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..50b647c1d71 --- /dev/null +++ b/systemtests/tests/config-dump/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + Address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show-verbose.conf b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show-verbose.conf new file mode 100644 index 00000000000..5c498d29d27 --- /dev/null +++ b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show-verbose.conf @@ -0,0 +1,547 @@ +Director { + Name = "bareos-dir" + Messages = "Daemon" + # DirAddresses = { + ipv4 = { + addr = 0.0.0.0 + port = 9101 + } + } + QueryFile = "/usr/lib/bareos/scripts/query.sql" + # WorkingDirectory = "/var/lib/bareos" + # PidDirectory = "/var/lib/bareos" + # Subscriptions = 0 + MaximumConcurrentJobs = 10 + # MaximumConnections = 30 + # MaximumConsoleConnections = 20 + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + # FdConnectTimeout = 3 minutes + # SdConnectTimeout = 30 minutes + # HeartbeatInterval = 0 + # StatisticsRetention = 5 years 1 months 5 days + # StatisticsCollectInterval = 150 + # OptimizeForSize = yes + # OptimizeForSpeed = no + # OmitDefaults = yes + # NdmpLogLevel = 4 + Auditing = yes + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + Address = "localhost" + # Port = 9102 + Password = "[md5]97a3419152ff86bedac46016e0c97271" + # Catalog = "MyCatalog" + # Passive = no + # ConnectionFromDirectorToClient = yes + # ConnectionFromClientToDirector = no + # Enabled = yes + # HardQuota = 0 + # SoftQuota = 0 + # SoftQuotaGracePeriod = 0 + # StrictQuotas = no + # QuotaIncludeFailedJobs = yes + # FileRetention = 2 months + # JobRetention = 6 months + # HeartbeatInterval = 0 + # AutoPrune = no + # MaximumConcurrentJobs = 1 + # NdmpLogLevel = 4 + # NdmpBlockSize = 63 k + # NdmpUseLmdb = yes + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + # BackupFormat = "Native" + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + WriteBootstrap = "/var/lib/bareos/%c.bsr" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + # BackupFormat = "Native" + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + Client = "bareos-fd" + FileSet = "LinuxAll" + Where = "/tmp/bareos-restores" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + # Type = Backup + # BackupFormat = "Native" + Level = Full + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + # Client = "bareos-fd" + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + JobDefs = "DefaultJob" + WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f "(Bareos) " -s "Bootstrap for Job %j" root" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + Priority = 11 + # AllowMixedPriority = no + run before job = "/usr/lib/bareos/scripts/make_catalog_backup.pl MyCatalog" + run after job = "/usr/lib/bareos/scripts/delete_catalog_backup" + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Job { + Name = "backup-bareos-fd" + # Type = Backup + # BackupFormat = "Native" + # Level = Incremental + # Messages = "Standard" + # Storage = "File" + # Pool = "Incremental" + # FullBackupPool = "Full" + # IncrementalBackupPool = "Incremental" + # DifferentialBackupPool = "Differential" + Client = "bareos-fd" + # FileSet = "SelfTest" + # Schedule = "WeeklyCycle" + JobDefs = "DefaultJob" + # WriteBootstrap = "/var/lib/bareos/%c.bsr" + # PrefixLinks = no + # PruneJobs = no + # PruneFiles = no + # PruneVolumes = no + # PurgeMigrationJob = no + # Enabled = yes + # SpoolAttributes = no + # SpoolData = no + # RerunFailedLevels = no + # PreferMountedVolumes = yes + # MaximumConcurrentJobs = 1 + # RescheduleOnError = no + # RescheduleInterval = 30 minutes + # RescheduleTimes = 5 + # Priority = 10 + # AllowMixedPriority = no + # Accurate = no + # AllowDuplicateJobs = yes + # AllowHigherDuplicates = yes + # CancelLowerLevelDuplicates = no + # CancelQueuedDuplicates = no + # CancelRunningDuplicates = no + # SaveFileHistory = yes + # FileHistorySize = 9 m 549 k 640 + # MaxConcurrentCopies = 100 + # AlwaysIncremental = no + # AlwaysIncrementalJobRetention = 0 + # AlwaysIncrementalKeepNumber = 0 + # MaxFullConsolidations = 0 + # RunOnIncomingConnectInterval = 0 +} + +Storage { + Name = "File" + Address = "vagrant" + # Port = 9103 + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" + # AutoChanger = no + # Enabled = yes + # AllowCompression = yes + # HeartbeatInterval = 0 + # CacheStatusInterval = 30 seconds + # MaximumConcurrentJobs = 1 + # MaximumConcurrentReadJobs = 0 + # CollectStatistics = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Catalog { + Name = "MyCatalog" + DbPassword = "8XZyLgZBx4kS" + DbUser = "bareos" + DbName = "bareos" + DbDriver = "postgresql" + # MultipleConnections = no + # DisableBatchInsert = no + # Reconnect = no + # ExitOnFatal = no + # MinConnections = 1 + # MaxConnections = 5 + # IncConnections = 1 + # IdleTimeout = 30 + # ValidateTimeout = 120 +} + +Schedule { + Name = "WeeklyCycle" + run = Full 1st Sat at 21:00 + run = Differential 2nd-5th Sat at 21:00 + run = Incremental Mon-Fri at 21:00 + # Enabled = yes +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + run = Full Mon-Fri at 21:10 + # Enabled = yes +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = MD5 + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + Wild Dir = "[A-Z]:/RECYCLER" + Wild Dir = "[A-Z]:/$RECYCLE.BIN" + Wild Dir = "[A-Z]:/System Volume Information" + Wild File = "[A-Z]:/pagefile.sys" + Drive Type = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 + OneFS = No + AclSupport = Yes + XattrSupport = Yes + Fs Type = "btrfs" + Fs Type = "ext2" + Fs Type = "ext3" + Fs Type = "ext4" + Fs Type = "reiserfs" + Fs Type = "jfs" + Fs Type = "xfs" + Fs Type = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +Pool { + Name = "Scratch" + PoolType = Scratch + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + # CatalogFiles = yes + # VolumeRetention = 1 years + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Incremental" + PoolType = Backup + LabelFormat = "Incremental-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 1 g + # CatalogFiles = yes + VolumeRetention = 1 months + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Full" + PoolType = Backup + LabelFormat = "Full-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 50 g + # CatalogFiles = yes + # VolumeRetention = 1 years + # AutoPrune = yes + # Recycle = yes +} + +Pool { + Name = "Differential" + PoolType = Backup + LabelFormat = "Differential-" + # LabelType = "bareos" + # CleaningPrefix = "CLN" + # UseCatalog = yes + # PurgeOldestVolume = no + # RecycleOldestVolume = no + # RecycleCurrentVolume = no + MaximumVolumes = 100 + MaximumVolumeBytes = 10 g + # CatalogFiles = yes + VolumeRetention = 3 months + # AutoPrune = yes + # Recycle = yes +} + +Messages { + Name = "Standard" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = all,!saved,!skipped,!audit + append = /var/log/bareos/bareos.log = all,!saved,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!saved,!skipped,!audit + operator = root = mount +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = /var/log/bareos/bareos-audit.log = audit + append = /var/log/bareos/bareos.log = all,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api",".help","use","version","status","list","llist",".clients",".jobs",".filesets",".pools",".storages",".defaults",".schedule",".bvfs_lsdirs",".bvfs_lsfiles",".bvfs_update",".bvfs_get_jobids",".bvfs_versions",".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "webui-admin" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + CommandACL = "status",".status" + # UsePamAuthentication = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + +Console { + Name = "admin" + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + Profile = "webui-admin" + # UsePamAuthentication = no + # TlsAuthenticate = no + TlsEnable = no + # TlsRequire = no + # TlsVerifyPeer = no +} + +Console { + Name = "*UserAgent*" + Description = "root console definition" + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + # UsePamAuthentication = no + # TlsAuthenticate = no + # TlsEnable = yes + # TlsRequire = no + # TlsVerifyPeer = no +} + diff --git a/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show.conf b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show.conf new file mode 100644 index 00000000000..e7a49a8d1ce --- /dev/null +++ b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-show.conf @@ -0,0 +1,280 @@ +Director { + Name = "bareos-dir" + Messages = "Daemon" + QueryFile = "/usr/lib/bareos/scripts/query.sql" + MaximumConcurrentJobs = 10 + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + Auditing = yes +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + Address = "localhost" + Password = "[md5]97a3419152ff86bedac46016e0c97271" +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + WriteBootstrap = "/var/lib/bareos/%c.bsr" +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + Client = "bareos-fd" + FileSet = "LinuxAll" + Where = "/tmp/bareos-restores" +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + Level = Full + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + JobDefs = "DefaultJob" + WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f "(Bareos) " -s "Bootstrap for Job %j" root" + Priority = 11 +} + +Job { + Name = "backup-bareos-fd" + Client = "bareos-fd" + JobDefs = "DefaultJob" +} + +Storage { + Name = "File" + Address = "vagrant" + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" +} + +Catalog { + Name = "MyCatalog" + DbPassword = "8XZyLgZBx4kS" + DbUser = "bareos" + DbName = "bareos" + DbDriver = "postgresql" +} + +Schedule { + Name = "WeeklyCycle" + run = Full 1st Sat at 21:00 + run = Differential 2nd-5th Sat at 21:00 + run = Incremental Mon-Fri at 21:00 +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + run = Full Mon-Fri at 21:10 +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = MD5 + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + Wild Dir = "[A-Z]:/RECYCLER" + Wild Dir = "[A-Z]:/$RECYCLE.BIN" + Wild Dir = "[A-Z]:/System Volume Information" + Wild File = "[A-Z]:/pagefile.sys" + Drive Type = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 + OneFS = No + AclSupport = Yes + XattrSupport = Yes + Fs Type = "btrfs" + Fs Type = "ext2" + Fs Type = "ext3" + Fs Type = "ext4" + Fs Type = "reiserfs" + Fs Type = "jfs" + Fs Type = "xfs" + Fs Type = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +Pool { + Name = "Scratch" + PoolType = Scratch +} + +Pool { + Name = "Incremental" + PoolType = Backup + LabelFormat = "Incremental-" + MaximumVolumes = 100 + MaximumVolumeBytes = 1 g + VolumeRetention = 1 months +} + +Pool { + Name = "Full" + PoolType = Backup + LabelFormat = "Full-" + MaximumVolumes = 100 + MaximumVolumeBytes = 50 g +} + +Pool { + Name = "Differential" + PoolType = Backup + LabelFormat = "Differential-" + MaximumVolumes = 100 + MaximumVolumeBytes = 10 g + VolumeRetention = 3 months +} + +Messages { + Name = "Standard" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = all,!saved,!skipped,!audit + append = /var/log/bareos/bareos.log = all,!saved,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!saved,!skipped,!audit + operator = root = mount +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = /var/log/bareos/bareos-audit.log = audit + append = /var/log/bareos/bareos.log = all,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api",".help","use","version","status","list","llist",".clients",".jobs",".filesets",".pools",".storages",".defaults",".schedule",".bvfs_lsdirs",".bvfs_lsfiles",".bvfs_update",".bvfs_get_jobids",".bvfs_versions",".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "webui-admin" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + CommandACL = "status",".status" +} + +Console { + Name = "admin" + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + Profile = "webui-admin" + TlsEnable = no +} + +Console { + Name = "*UserAgent*" + Description = "root console definition" + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" +} + diff --git a/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-xc.conf b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-xc.conf new file mode 100644 index 00000000000..0056680ec4e --- /dev/null +++ b/systemtests/tests/config-dump/etc/orig/bareos-dir-19.2.7-xc.conf @@ -0,0 +1,293 @@ +Director { + Name = "bareos-dir" + Messages = "Daemon" + QueryFile = "/usr/lib/bareos/scripts/query.sql" + MaximumConcurrentJobs = 10 + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + Auditing = yes +} + +Client { + Name = "bareos-fd" + Description = "Client resource of the Director itself." + Address = "localhost" + Password = "[md5]97a3419152ff86bedac46016e0c97271" +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + FullBackupPool = "Full" + IncrementalBackupPool = "Incremental" + DifferentialBackupPool = "Differential" + Client = "bareos-fd" + FileSet = "SelfTest" + Schedule = "WeeklyCycle" + WriteBootstrap = "/var/lib/bareos/%c.bsr" + Priority = 10 +} + +Job { + Name = "backup-bareos-fd" + Client = "bareos-fd" + JobDefs = "DefaultJob" +} + +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Messages = "Standard" + Storage = "File" + Pool = "Incremental" + Client = "bareos-fd" + FileSet = "LinuxAll" + Where = "/tmp/bareos-restores" +} + +Job { + Name = "BackupCatalog" + Description = "Backup the catalog database (after the nightly save)" + Level = Full + FileSet = "Catalog" + Schedule = "WeeklyCycleAfterBackup" + JobDefs = "DefaultJob" + WriteBootstrap = "|/usr/bin/bsmtp -h localhost -f "(Bareos) " -s "Bootstrap for Job %j" root" + Priority = 11 +} + +Storage { + Name = "File" + Address = "vagrant" + Password = "[md5]4f389409b83d78959bc9fd95292fb63a" + Device = "FileStorage" + MediaType = "File" +} + +Catalog { + Name = "MyCatalog" + DbPassword = "8XZyLgZBx4kS" + DbUser = "bareos" + DbName = "bareos" + DbDriver = "postgresql" +} + +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." + run = Full Mon-Fri at 21:10 +} + +Schedule { + Name = "WeeklyCycle" + run = Full 1st Sat at 21:00 + run = Differential 2nd-5th Sat at 21:00 + run = Incremental Mon-Fri at 21:00 +} + +FileSet { + Name = "Windows All Drives" + Include { + Options { + Signature = MD5 + IgnoreCase = Yes + Exclude = Yes + AclSupport = Yes + XattrSupport = Yes + Wild Dir = "[A-Z]:/RECYCLER" + Wild Dir = "[A-Z]:/$RECYCLE.BIN" + Wild Dir = "[A-Z]:/System Volume Information" + Wild File = "[A-Z]:/pagefile.sys" + Drive Type = "fixed" + } + File = "/" + } +} + +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/usr/sbin" + } +} + +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 + OneFS = No + AclSupport = Yes + XattrSupport = Yes + Fs Type = "btrfs" + Fs Type = "ext2" + Fs Type = "ext3" + Fs Type = "ext4" + Fs Type = "reiserfs" + Fs Type = "jfs" + Fs Type = "xfs" + Fs Type = "zfs" + } + File = "/" + } + Exclude { + File = "/var/lib/bareos" + File = "/var/lib/bareos/storage" + File = "/proc" + File = "/tmp" + File = "/var/tmp" + File = "/.journal" + File = "/.fsck" + } +} + +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + Signature = MD5 + AclSupport = Yes + XattrSupport = Yes + } + File = "/var/lib/bareos/bareos.sql" + File = "/etc/bareos" + } +} + +Pool { + Name = "Scratch" + PoolType = Scratch +} + +Pool { + Name = "Incremental" + PoolType = Backup + LabelFormat = "Incremental-" + MaximumVolumes = 100 + MaximumVolumeBytes = 1 g + VolumeRetention = 1 months + AutoPrune = yes + Recycle = yes +} + +Pool { + Name = "Full" + PoolType = Backup + LabelFormat = "Full-" + MaximumVolumes = 100 + MaximumVolumeBytes = 50 g + VolumeRetention = 1 years + AutoPrune = yes + Recycle = yes +} + +Pool { + Name = "Differential" + PoolType = Backup + LabelFormat = "Differential-" + MaximumVolumes = 100 + MaximumVolumeBytes = 10 g + VolumeRetention = 3 months + AutoPrune = yes + Recycle = yes +} + +Messages { + Name = "Standard" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + OperatorCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + catalog = all,!saved,!skipped,!audit + append = /var/log/bareos/bareos.log = all,!saved,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!saved,!skipped,!audit + operator = root = mount +} + +Messages { + Name = "Daemon" + MailCommand = "/usr/bin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + append = /var/log/bareos/bareos-audit.log = audit + append = /var/log/bareos/bareos.log = all,!skipped,!audit + console = all,!saved,!skipped,!audit + mail = root = all,!skipped,!audit +} + +Profile { + Name = "webui-readonly" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = ".api",".help","use","version","status","list","llist",".clients",".jobs",".filesets",".pools",".storages",".defaults",".schedule",".bvfs_lsdirs",".bvfs_lsfiles",".bvfs_update",".bvfs_get_jobids",".bvfs_versions",".bvfs_restore" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "webui-admin" + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" +} + +Profile { + Name = "operator" + Description = "Profile allowing normal Bareos operations." + JobACL = "*all*" + ClientACL = "*all*" + StorageACL = "*all*" + ScheduleACL = "*all*" + PoolACL = "*all*" + CommandACL = "!.bvfs_clear_cache","!.exit","!.sql","!configure","!create","!delete","!purge","!prune","!sqlquery","!umount","!unmount","*all*" + FileSetACL = "*all*" + CatalogACL = "*all*" + WhereACL = "*all*" + PluginOptionsACL = "*all*" +} + +Console { + Name = "bareos-mon" + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "[md5]4cf5943929b8447731b086f0f43f7f99" + JobACL = "*all*" + CommandACL = "status",".status" +} + +Console { + Name = "admin" + Password = "[md5]5ebe2294ecd0e0f08eab7690d2a6ee69" + Profile = "webui-admin" + TlsEnable = no +} + +Console { + Name = "*UserAgent*" + Description = "root console definition" + Password = "[md5]1499042c6de7a645bcb4c21f3e05dc3a" + UsePamAuthentication = no + TlsAuthenticate = no + TlsEnable = yes + TlsRequire = no + TlsVerifyPeer = no +} + diff --git a/systemtests/tests/config-dump/testrunner b/systemtests/tests/config-dump/testrunner new file mode 100755 index 00000000000..f95dc80776f --- /dev/null +++ b/systemtests/tests/config-dump/testrunner @@ -0,0 +1,171 @@ +#!/bin/bash +# + +set -e +set -u + +start_bareos_dir() +{ + BAREOS_DIR_EXTRA_OPTIONS="$@" + + output=/dev/null + BAREOS_DIR_OPTIONS="" + if is_debug; then + #BAREOS_DIR_OPTIONS="-d 200" + output=/dev/stdout + "${BAREOS_DIRECTOR_BINARY}" ${BAREOS_DIR_EXTRA_OPTIONS} -f ${BAREOS_DIR_OPTIONS} >$output 2>&1 & + else + "${BAREOS_DIRECTOR_BINARY}" ${BAREOS_DIR_EXTRA_OPTIONS} -f >$output 2>&1 & + fi + + sleep 1 + + if ! ${rscripts}/bareos-ctl-dir status >/dev/null; then + set_error "Director does not run anymore. This should not happen." + exit 1 + fi +} + +remove_bconsole_commands_from_output() +{ + FILE="$1" + # remove first and last line from file + sed -i -e '1d' -e '$ d' ${FILE} +} + +dump_config() +{ + # start bareos-dir with config file + # and export it in 4 different formats: + # plain + # plain-verbose + # json + # json-verbose + configfile="$1" + ext="$2" + + if ! [ -e "${configfile}" ]; then + set_error "Director config file \"${configfile}\" does not exist." + exit 1 + fi + + "${BAREOS_DIRECTOR_BINARY}" -c "${configfile}" -xc > $tmp/bareos-dir-xc-${ext}.conf + + start_bareos_dir -c "${configfile}" + +cat <$tmp/bconcmds +@$out $tmp/log-${ext}.out +status director +@$out $tmp/bareos-dir-show-${ext}.conf +show all +@$out $tmp/bareos-dir-show-verbose-${ext}.conf +show all verbose +@$out +.api json +@$out $tmp/bareos-dir-show-${ext}.json +show all +@$out $tmp/bareos-dir-show-verbose-${ext}.json +show all verbose +@$out +quit +END_OF_DATA + + run_bconsole + + remove_bconsole_commands_from_output "$tmp/bareos-dir-show-${ext}.conf" + remove_bconsole_commands_from_output "$tmp/bareos-dir-show-verbose-${ext}.conf" + remove_bconsole_commands_from_output "$tmp/bareos-dir-show-${ext}.json" + remove_bconsole_commands_from_output "$tmp/bareos-dir-show-verbose-${ext}.json" + + stop_bareos > $output 2>&1 + + if ${rscripts}/bareos-ctl-dir status >/dev/null; then + set_error "Director is not stopped." + exit 1 + fi +} + +TestName="$(basename "$(pwd)")" +export TestName + +#shellcheck source=../environment.in +. ./environment + +JobName=backup-bareos-fd +#shellcheck source=../scripts/functions +. "${rscripts}"/functions +"${rscripts}"/cleanup +"${rscripts}"/setup + +# Directory to backup. +# This directory will be created by setup_data(). +#BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +#setup_data + +start_test + +${scripts}/bareos-config initialize_database_driver + +# bareos-dir-19.2.7-xc.conf: +# output of bareos-dir -xc (manually adapted) +# from a default installation of version 19.2.7 +dump_config "${conf}/bareos-dir-19.2.7-xc.conf" "1" + +dump_config "${tmp}/bareos-dir-show-1.conf" "2" + +# bareos-dir-full.conf: +# configuration with as many config directives set. +dump_config "${conf}/bareos-dir-full.conf" "full1" + +dump_config "${tmp}/bareos-dir-show-verbose-full1.conf" "full2" + + +# compare config export from +# bareos-dir-19.2.7-xc +# with re-exported version. +if ! diff "$tmp/bareos-dir-show-1.conf" "$tmp/bareos-dir-show-2.conf"; then + set_error "Configuration dumped (1), re-read (1) and dumped (2) differs. This should not happen." + exit 1 +fi + +# compare verbose config export from +# bareos-dir-19.2.7-xc +# with re-exported version. +if ! diff "$tmp/bareos-dir-show-verbose-1.conf" "$tmp/bareos-dir-show-verbose-2.conf"; then + set_error "Configuration dumped (1), re-read (1) and dumped (2) differs. This should not happen." + exit 1 +fi + +# Don't compare directly, +# as there are known differences. +#if ! diff "${conf}/bareos-dir-full.conf" "$tmp/bareos-dir-show-full1.conf"; then +# set_error "Configuration dumped (full1) differs. This should not happen." +# exit 1 +#fi +DIFF_CMD='diff "${conf}/bareos-dir-full.conf" "$tmp/bareos-dir-show-verbose-full1.conf"' +if ! eval "$DIFF_CMD" > "$tmp/bareos-dir-full_bareos-dir-show-verbose-full1.diff"; then + if is_debug; then + # There are known problems. + # These must be fixed in the config parser. + echo "Known differences between bareos-dir-full.conf and bareos-dir-show-verbose-full1.conf:" + echo $DIFF_CMD + cat "$tmp/bareos-dir-full_bareos-dir-show-verbose-full1.diff" + fi +fi + +# Compare export and re-export from bareos-dir-full.conf. +if ! diff "${tmp}/bareos-dir-show-full1.conf" "$tmp/bareos-dir-show-full2.conf"; then + set_error "Configuration dumped (full1), reread (full1) and dumped (full2) differs. This should not happen." + exit 1 +fi + +# Compare export and re-export from bareos-dir-full.conf(verbose versions). +if ! diff "${tmp}/bareos-dir-show-verbose-full1.conf" "$tmp/bareos-dir-show-verbose-full2.conf"; then + set_error "Verbose configuration dumped (full1), reread (full1) and dumped (full2) differs. This should not happen." + exit 1 +fi + +end_test