mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-30 17:05:19 +08:00
d4f85066a0
在计划任务的备份类型中新增"目录"子类型,支持将任意指定目录打包压缩后 备份到本地或远程存储,并自动清理过期备份。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
898 B
Go
19 lines
898 B
Go
package types
|
||
|
||
// CronConfig 计划任务结构化配置
|
||
type CronConfig struct {
|
||
Type string `json:"type"` // 子类型:backup 时为 website/mysql/postgres/path;cutoff 时为 website/container
|
||
Flock bool `json:"flock"` // 进程锁
|
||
Targets []string `json:"targets"` // 目标列表
|
||
Storage uint `json:"storage"` // 存储 ID(0=本地)
|
||
Keep uint `json:"keep"` // 保留份数
|
||
// URL 任务专用
|
||
URL string `json:"url"`
|
||
Method string `json:"method"` // GET/POST/PUT/DELETE/PATCH/HEAD
|
||
Headers map[string]string `json:"headers"` // 自定义请求头
|
||
Body string `json:"body"` // 请求体
|
||
Timeout uint `json:"timeout"` // 超时时间(秒)
|
||
Insecure bool `json:"insecure"` // 忽略证书校验
|
||
Retries uint `json:"retries"` // 失败重试次数
|
||
}
|