fix(deploy): 在线更新备份 - 兼容 root-only 历史数据文件

This commit is contained in:
ddCat
2026-08-30 23:56:33 +08:00
parent 3f16cf19aa
commit 2b7375f631
4 changed files with 45 additions and 2 deletions

View File

@@ -301,7 +301,7 @@ func (m *Manager) createBackup(version string) (Backup, error) {
if err != nil {
return Backup{}, err
}
if err := m.compose(m.composePath(), version, m.config.StepTimeout, dataEntry, "exec", "-T", "backend", "tar", "-C", "/data", "-cf", "-", "."); err != nil {
if err := m.compose(m.composePath(), version, m.config.StepTimeout, dataEntry, "exec", "-T", "--user", "root", "backend", "tar", "-C", "/data", "-cf", "-", "."); err != nil {
return Backup{}, fmt.Errorf("备份数据目录:%w", err)
}
if err := archive.Close(); err != nil {