Skip to content

Commit

Permalink
doc,chart: add the both s3 nfs backup documents #735
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke committed Nov 9, 2022
1 parent 448e4ff commit 83917d7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ spec:
description: Represents the name of the secret that contains credentials
to connect to the storage provider to store backups.
type: string
bothS3NFS:
description: Specify that crontab job backup both on NFS and S3 storage.
properties:
nfsSchedule:
description: NFS schedule.
type: string
s3Schedule:
type: string
type: object
metricsOpts:
default:
enabled: false
Expand Down
21 changes: 19 additions & 2 deletions docs/en-us/backup_cron.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contents
- [Cron expression format](#cron-expression-format)
- [Special characters](#special-characters)
- [Predefined schedules](#predefined-schedules)

- [both cron backup for s3 and nfs](#both-s3-nfs)
# Overview
The scheduled backup is currently supported for both S3 and NFS backups. You can use the cron expression to specify the backup schedule. Set the `backupSchedule` parameter under the `spec` field in the YAML file of the cluster, for example:

Expand Down Expand Up @@ -64,4 +64,21 @@ You may use one of several pre-defined schedules in place of a cron expression.
| @monthly | Run once a month, midnight, first of month | 0 0 0 1 * * |
| @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0 |
| @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * |
| @hourly | Run once an hour, beginning of hour | 0 0 * * * * |
| @hourly | Run once an hour, beginning of hour | 0 0 * * * * |

# both cron backup for s3 and nfs
if you have specified the `backupSecretName` , `nfsServerAddress` and `backupSchedule` , the operator will run nfs backup instead of s3 backup, but if you want backup them both, you should specify `bothS3NFS`
field. it has two sub fields.
* nfsSchedule: nfs' Cron expression, reference from [Predefined schedules](#Predefined-schedules)
* s3Schedule: s3's Cron expression, reference from [Predefined schedules](#Predefined-schedules)
for examples:
```yaml
...
spec:
replicas: 3
mysqlVersion: "5.7"
bothS3NFS:
nfsSchedule: "0 0 0 * * *"
s3Schedule: "0 0 2 * * *"
...
```
18 changes: 17 additions & 1 deletion docs/zh-cn/backup_cron.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [Cron 表达式格式](#cron-表达式格式)
- [特殊字符](#特殊字符)
- [预定义时间表](#预定义时间表)

- [S3与NFS联合定时备份](#S3与NFS联合定时备份)
# 简介
目前,无论 S3 还是 NFS 备份,均支持定时备份,并支持使用 Cron 表达式来指定备份的时间策略。您只需直接在集群的 YAML 文件的 `spec` 下设置 `backupSchedule` 字段。例如:

Expand Down Expand Up @@ -67,3 +67,19 @@ spec:
| @weekly | 每周执行一次,在周六和周日之间的夜晚 12 点执行 | 0 0 0 * * 0 |
| @daily(或 @midnight| 每日执行一次,在夜晚 12 点执行 | 0 0 0 * * * |
| @hourly | 每小时执行一次,在第 1 分钟执行 | 0 0 * * * * |

# S3与NFS联合定时备份
同时配置了 `backupSecretName``nfsServerAddress` 以及 `backupSchedule` 情况下, 定时备份会优先使用 `nfs` 进行备份,而不会进行 S3 备份 如果您需要同时进行 `S3``nfs` 的定时备份, 需要新增 `bothS3NFS` 选项. 有如下两个子项:
* nfsSchedule: nfs 备份Cron 表达式, 格式参见 [预定义时间表](#预定义时间表)
* s3Schedule: s3 备份Cron 表达式, 格式参见 [预定义时间表](#预定义时间表)
示例:
```yaml
...
spec:
replicas: 3
mysqlVersion: "5.7"
bothS3NFS:
nfsSchedule: "0 0 0 * * *"
s3Schedule: "0 0 2 * * *"
...
```

0 comments on commit 83917d7

Please sign in to comment.