Add types.exclude pattern
This commit is contained in:
@ -100,11 +100,13 @@ func main() {
|
||||
user := deviceConfig.User
|
||||
commands := deviceConfig.Commands
|
||||
deviceType := deviceConfig.Type
|
||||
var excludePatterns []string
|
||||
|
||||
// If device has a type, get commands from types section
|
||||
// If device has a type, get commands and exclude patterns from types section
|
||||
if deviceType != "" {
|
||||
if typeConfig, exists := cfg.Types[deviceType]; exists {
|
||||
commands = typeConfig.Commands
|
||||
excludePatterns = typeConfig.Exclude
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +129,7 @@ func main() {
|
||||
continue
|
||||
}
|
||||
|
||||
err = backup.BackupCommands(commands, outputDir)
|
||||
err = backup.BackupCommands(commands, excludePatterns, outputDir)
|
||||
backup.Disconnect()
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user