fix 任务周期备份配置文件发送ftp备份路径去掉一层
This commit is contained in:
@@ -30,7 +30,7 @@ func (s *NeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
s.count++ // 执行次数加一
|
||||
options := data.(cron.JobData)
|
||||
sysJob := options.SysJob
|
||||
logger.Infof("重复 %v 任务ID %s", options.Repeat, sysJob.JobID)
|
||||
logger.Infof("重复:%v 任务ID:%s 执行次数:%d", options.Repeat, sysJob.JobID, s.count)
|
||||
// 返回结果,用于记录执行结果
|
||||
result := map[string]any{
|
||||
"count": s.count,
|
||||
@@ -40,7 +40,7 @@ func (s *NeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
for _, neInfo := range neList {
|
||||
neTypeAndId := fmt.Sprintf("%s_%s", neInfo.NeType, neInfo.NeId)
|
||||
// 将网元文件备份到本地
|
||||
zipFilePath, err := s.neConfigBackupService.NeConfigNeToLocal(neInfo)
|
||||
zipFilePath, err := s.neConfigBackupService.FileNeToLocal(neInfo)
|
||||
if err != nil {
|
||||
result[neTypeAndId] = err.Error()
|
||||
continue
|
||||
@@ -62,7 +62,7 @@ func (s *NeConfigBackupProcessor) Execute(data any) (any, error) {
|
||||
|
||||
msg := "ok"
|
||||
// 上传到FTP服务器
|
||||
if err := s.backupService.FTPPushFile(zipFilePath, "ne_config"); err != nil {
|
||||
if err := s.backupService.FTPPushFile(zipFilePath, ""); err != nil {
|
||||
result[neTypeAndId] = msg + ", ftp err:" + err.Error()
|
||||
}
|
||||
result[neTypeAndId] = msg
|
||||
|
||||
Reference in New Issue
Block a user