mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-11 00:54:55 +08:00
fix: Fix the problem of eliminating file exceptions in the backup dir… (#8596)
This commit is contained in:
parent
633dbe1aec
commit
55bab2e255
2 changed files with 7 additions and 3 deletions
|
@ -732,8 +732,7 @@ func (f FileOp) TarGzCompressPro(withDir bool, src, dst, secret, exclusionRules
|
|||
if _, ok := exMap[exclude]; ok {
|
||||
continue
|
||||
}
|
||||
exStr += " --exclude "
|
||||
exStr += exclude
|
||||
exStr += fmt.Sprintf(" --exclude '%s'", exclude)
|
||||
exMap[exclude] = struct{}{}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ func HandleTar(sourceDir, targetDir, name, exclusionRules string, secret string)
|
|||
}
|
||||
}
|
||||
|
||||
exMap := make(map[string]struct{})
|
||||
excludes := strings.Split(exclusionRules, ",")
|
||||
excludeRules := ""
|
||||
excludes = append(excludes, "*.sock")
|
||||
|
@ -87,7 +88,11 @@ func HandleTar(sourceDir, targetDir, name, exclusionRules string, secret string)
|
|||
if len(exclude) == 0 {
|
||||
continue
|
||||
}
|
||||
excludeRules += " --exclude " + exclude
|
||||
if _, ok := exMap[exclude]; ok {
|
||||
continue
|
||||
}
|
||||
excludeRules += fmt.Sprintf(" --exclude '%s'", exclude)
|
||||
exMap[exclude] = struct{}{}
|
||||
}
|
||||
path := ""
|
||||
if strings.Contains(sourceDir, "/") {
|
||||
|
|
Loading…
Add table
Reference in a new issue