fix: 备份数据输出路径变更

This commit is contained in:
TsMask
2025-03-18 19:29:58 +08:00
parent db64dd8ce9
commit f767e14bf1
4 changed files with 6 additions and 6 deletions

View File

@@ -90,7 +90,7 @@ func (s *DeleteNeConfigBackupProcessor) Execute(data any) (any, error) {
// deleteFile 删除本地文件 // deleteFile 删除本地文件
func (s DeleteNeConfigBackupProcessor) deleteFile(neType, neId string, oldFileDate time.Time) { func (s DeleteNeConfigBackupProcessor) deleteFile(neType, neId string, oldFileDate time.Time) {
neTypeLower := strings.ToLower(neType) neTypeLower := strings.ToLower(neType)
localPath := fmt.Sprintf("/usr/local/etc/omc/ne_config/%s/%s/backup ", neTypeLower, neId) localPath := fmt.Sprintf("/usr/local/omc/backup/ne_config/%s/%s/backup ", neTypeLower, neId)
files, err := os.ReadDir(localPath) files, err := os.ReadDir(localPath)
if err != nil { if err != nil {
logger.Errorf("logger Remove ne_config File ReadDir err: %v", err.Error()) logger.Errorf("logger Remove ne_config File ReadDir err: %v", err.Error())

View File

@@ -70,7 +70,7 @@ func (s NeConfigBackup) DeleteByIds(ids []int64) (int64, error) {
func (s NeConfigBackup) FileLocalToNe(neInfo model.NeInfo, localFile string) error { func (s NeConfigBackup) FileLocalToNe(neInfo model.NeInfo, localFile string) error {
neTypeLower := strings.ToLower(neInfo.NeType) neTypeLower := strings.ToLower(neInfo.NeType)
// 网管本地路径 // 网管本地路径
omcPath := "/usr/local/etc/omc/ne_config" omcPath := "/usr/local/omc/backup/ne_config"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
omcPath = fmt.Sprintf("C:%s", omcPath) omcPath = fmt.Sprintf("C:%s", omcPath)
} }
@@ -149,7 +149,7 @@ func (s NeConfigBackup) FileNeToLocal(neInfo model.NeInfo) (string, error) {
neTypeLower := strings.ToLower(neInfo.NeType) neTypeLower := strings.ToLower(neInfo.NeType)
// 网管本地路径 // 网管本地路径
omcPath := "/usr/local/etc/omc/ne_config" omcPath := "/usr/local/omc/backup/ne_config"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
omcPath = fmt.Sprintf("C:%s", omcPath) omcPath = fmt.Sprintf("C:%s", omcPath)
} }

View File

@@ -593,7 +593,7 @@ func (r NeInfo) neConfOAMRead(neType, neId string, sync bool) (map[string]any, e
neTypeLower := strings.ToLower(neType) neTypeLower := strings.ToLower(neType)
fileName := "oam_manager.yaml" fileName := "oam_manager.yaml"
// 网管本地路径 // 网管本地路径
localFilePath := fmt.Sprintf("/usr/local/etc/omc/ne_config/%s/%s/%s", neTypeLower, neId, fileName) localFilePath := fmt.Sprintf("/usr/local/omc/backup/ne_config/%s/%s/%s", neTypeLower, neId, fileName)
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
localFilePath = fmt.Sprintf("C:%s", localFilePath) localFilePath = fmt.Sprintf("C:%s", localFilePath)
} }
@@ -648,7 +648,7 @@ func (r NeInfo) neConfOAMWirte(neType, neId string, content any, sync bool) erro
neTypeLower := strings.ToLower(neType) neTypeLower := strings.ToLower(neType)
fileName := "oam_manager.yaml" fileName := "oam_manager.yaml"
// 网管本地路径 // 网管本地路径
omcPath := "/usr/local/etc/omc/ne_config" omcPath := "/usr/local/omc/backup/ne_config"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
omcPath = fmt.Sprintf("C:%s", omcPath) omcPath = fmt.Sprintf("C:%s", omcPath)
} }

View File

@@ -100,7 +100,7 @@ func (r *NeLicense) FindByNeTypeAndNeID(neType, neId string) model.NeLicense {
func (r *NeLicense) ReadLicenseInfo(neLicense model.NeLicense) (string, string) { func (r *NeLicense) ReadLicenseInfo(neLicense model.NeLicense) (string, string) {
neTypeLower := strings.ToLower(neLicense.NeType) neTypeLower := strings.ToLower(neLicense.NeType)
// 网管本地路径 // 网管本地路径
omcPath := "/usr/local/etc/omc/ne_license" omcPath := "/usr/local/omc/backup/ne_license"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
omcPath = fmt.Sprintf("C:%s", omcPath) omcPath = fmt.Sprintf("C:%s", omcPath)
} }