style: 添加系统备份功能,权限控制分配

This commit is contained in:
TsMask
2025-09-19 16:14:27 +08:00
parent adda53889f
commit 9f653c650b
5 changed files with 10 additions and 10 deletions

View File

@@ -169,8 +169,8 @@ func (s NeConfigBackup) FileNeToLocalPath(neInfo model.NeInfo, localDirPath stri
}
// 网元端复制到本地
if err := file.CopyDir(neDirTemp, localDirPath); err != nil {
return fmt.Errorf("copy config err")
if err = sftpClient.CopyDirRemoteToLocal(neDirTemp, localDirPath); err != nil {
return fmt.Errorf("copy config from ne err")
}
sshClient.RunCMD(fmt.Sprintf("sudo rm -rf %s", neDirTemp)) // 删除临时目录
return nil