Skip to content

Commit fe24fd1

Browse files
author
ssongliu
committed
fix: Fix the failure to back up file names containing Spaces for scheduled jobs
1 parent 220b622 commit fe24fd1

12 files changed

Lines changed: 14 additions & 6 deletions

File tree

agent/app/service/cronjob_backup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ func (u *CronjobService) handleWebsite(cronjob model.Cronjob, startTime time.Tim
8383
record.Name = web.Alias
8484
record.DetailName = web.Alias
8585
record.DownloadAccountID, record.SourceAccountIDs = cronjob.DownloadAccountID, cronjob.SourceAccountIDs
86-
backupDir := path.Join(global.Dir.TmpDir, fmt.Sprintf("website/%s", web.PrimaryDomain))
87-
record.FileName = fmt.Sprintf("website_%s_%s.tar.gz", web.PrimaryDomain, startTime.Format(constant.DateTimeSlimLayout)+common.RandStrAndNum(5))
86+
backupDir := path.Join(global.Dir.TmpDir, fmt.Sprintf("website/%s", web.Alias))
87+
record.FileName = fmt.Sprintf("website_%s_%s.tar.gz", web.Alias, startTime.Format(constant.DateTimeSlimLayout)+common.RandStrAndNum(5))
8888
if err := handleWebsiteBackup(&web, backupDir, record.FileName, cronjob.ExclusionRules, cronjob.Secret, taskID); err != nil {
8989
return err
9090
}

agent/utils/files/file_op.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func (f FileOp) TarGzFilesWithCompressPro(list []string, dst, secret string) err
768768

769769
var filelist []string
770770
for _, item := range list {
771-
filelist = append(filelist, "-C "+path.Dir(item)+" "+path.Base(item))
771+
filelist = append(filelist, "-C '"+path.Dir(item)+"' '"+path.Base(item)+"' ")
772772
}
773773
commands := ""
774774
if len(secret) != 0 {

frontend/src/lang/modules/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ const message = {
12901290
settings: 'Setting',
12911291
cronjobs: 'Cronjob',
12921292
databases: 'Database',
1293+
waf: 'WAF',
12931294
licenses: 'License',
12941295
nodes: 'Node',
12951296
commands: 'Quick Commands',

frontend/src/lang/modules/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ const message = {
12271227
settings: 'パネル設定',
12281228
cronjobs: 'スケジュールされたタスク',
12291229
databases: 'データベース',
1230+
waf: 'WAF',
12301231
licenses: 'ライセンス',
12311232
nodes: 'ノード',
12321233
commands: 'クイックコマンド',

frontend/src/lang/modules/ko.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ const message = {
12141214
logs: '로그 감사',
12151215
settings: '패널 설정',
12161216
cronjobs: '예약 작업',
1217+
waf: 'WAF',
12171218
databases: '데이터베이스',
12181219
licenses: '라이선스',
12191220
nodes: '노드',

frontend/src/lang/modules/ms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,7 @@ const message = {
12691269
logs: 'Audit Log',
12701270
settings: 'Tetapan Panel',
12711271
cronjobs: 'Tugas Terjadual',
1272+
waf: 'WAF',
12721273
databases: 'Pangkalan',
12731274
licenses: 'lesen',
12741275
nodes: 'nod',

frontend/src/lang/modules/pt-br.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,7 @@ const message = {
12521252
logs: 'Auditoria de Logs',
12531253
settings: 'Configurações do Painel',
12541254
cronjobs: 'Tarefas Agendadas',
1255+
waf: 'WAF',
12551256
databases: 'Bancos de Dados',
12561257
licenses: 'licenças',
12571258
nodes: 'nós',

frontend/src/lang/modules/ru.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ const message = {
12601260
logs: 'Аудит журналов',
12611261
settings: 'Настройки панели',
12621262
cronjobs: 'Запланированные задачи',
1263+
waf: 'WAF',
12631264
databases: 'Базы данных',
12641265
licenses: 'лицензии',
12651266
nodes: 'ноды',

frontend/src/lang/modules/zh-Hant.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ const message = {
12191219
logs: '日誌審計',
12201220
settings: '面板設定',
12211221
cronjobs: '計畫任務',
1222+
waf: 'WAF',
12221223
databases: '資料庫',
12231224
licenses: '許可證',
12241225
nodes: '節點',

frontend/src/lang/modules/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@ const message = {
12181218
settings: '面板设置',
12191219
cronjobs: '计划任务',
12201220
databases: '数据库',
1221+
waf: 'WAF',
12211222
licenses: '许可证',
12221223
nodes: '节点',
12231224
commands: '快速命令',

0 commit comments

Comments
 (0)