mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-10 03:30:53 +08:00
fix: 解决快照套接字忽略失败的问题 (#6273)
This commit is contained in:
parent
5851124dee
commit
6597caaf05
1 changed files with 1 additions and 6 deletions
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
pathUtils "path"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
@ -260,11 +259,7 @@ func handleSnapTar(sourceDir, targetDir, name, exclusionRules string, secret str
|
||||||
commands = fmt.Sprintf("tar --warning=no-file-changed --ignore-failed-read --exclude-from=<(find %s -type s -print) -zcf %s %s %s %s", sourceDir, " -"+exStr, path, extraCmd, targetDir+"/"+name)
|
commands = fmt.Sprintf("tar --warning=no-file-changed --ignore-failed-read --exclude-from=<(find %s -type s -print) -zcf %s %s %s %s", sourceDir, " -"+exStr, path, extraCmd, targetDir+"/"+name)
|
||||||
global.LOG.Debug(strings.ReplaceAll(commands, fmt.Sprintf(" %s ", secret), "******"))
|
global.LOG.Debug(strings.ReplaceAll(commands, fmt.Sprintf(" %s ", secret), "******"))
|
||||||
} else {
|
} else {
|
||||||
itemPrefix := pathUtils.Base(sourceDir)
|
commands = fmt.Sprintf("tar --warning=no-file-changed --ignore-failed-read --exclude-from=<(find %s -type s -printf '%s' | sed 's|^|./|') -zcf %s %s -C %s .", sourceDir, "%P\n", targetDir+"/"+name, exStr, sourceDir)
|
||||||
if itemPrefix == "/" {
|
|
||||||
itemPrefix = ""
|
|
||||||
}
|
|
||||||
commands = fmt.Sprintf("tar --warning=no-file-changed --ignore-failed-read --exclude-from=<(find %s -type s -printf '%s' | sed 's|^|%s/|') -zcf %s %s -C %s .", sourceDir, "%P\n", itemPrefix, targetDir+"/"+name, exStr, sourceDir)
|
|
||||||
global.LOG.Debug(commands)
|
global.LOG.Debug(commands)
|
||||||
}
|
}
|
||||||
stdout, err := cmd.ExecWithTimeOut(commands, 30*time.Minute)
|
stdout, err := cmd.ExecWithTimeOut(commands, 30*time.Minute)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue