You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups
366
+
Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups. Use `--schedule` instead of intervals to run backups on cron expressions
367
367
368
368
OPTIONS:
369
369
--config value, -c value Config 'FILE' name. (default: "/etc/clickhouse-backup/config.yml") [$CLICKHOUSE_BACKUP_CONFIG]
370
370
--environment-override value, --env value override any environment variable via CLI parameter
371
371
--watch-interval value Interval for run 'create_remote' + 'delete local' for incremental backup, look format https://pkg.go.dev/time#ParseDuration
372
372
--full-interval value Interval for run 'create_remote'+'delete local' when stop create incremental backup sequence and create full backup, look format https://pkg.go.dev/time#ParseDuration
373
373
--watch-backup-name-template value Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples
374
+
--schedule value Named cron driven backup chain in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval
375
+
cron expression contains standard 5 fields, optional leading seconds field and @every/@daily descriptors, see https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format
376
+
name added as prefix to --watch-backup-name-template to isolate backup chains
377
+
full_type=rebase creates scheduled full backup as increment + rebase command, server-side copy of previous chain instead of full re-upload
378
+
delete_previous_cycle=true deletes all older backups of the chain after successful full backup
374
379
--table value, --tables value, -t value Create and upload only objects which matched with table name patterns, separated by comma, allow ? and * as wildcard
375
380
--partitions partition_id Partitions names, separated by comma
376
381
If PARTITION BY clause returns numeric not hashed values for partition_id field in system.parts table, then use --partitions=partition_id1,partition_id2 format
@@ -411,6 +416,7 @@ OPTIONS:
411
416
--watch-interval value Interval for run 'create_remote' + 'delete local' for incremental backup, look format https://pkg.go.dev/time#ParseDuration
412
417
--full-interval value Interval for run 'create_remote'+'delete local' when stop create incremental backup sequence and create full backup, look format https://pkg.go.dev/time#ParseDuration
413
418
--watch-backup-name-template value Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples
419
+
--schedule value Named cron driven backup chain for watch in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval
414
420
--watch-delete-source, --watch-delete-local explicitly delete local backup during upload in watch
Copy file name to clipboardExpand all lines: ReadMe.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,20 @@ general:
168
168
watch_interval: 1h# WATCH_INTERVAL, use only for `watch` command, backup will create every 1h
169
169
full_interval: 24h# FULL_INTERVAL, use only for `watch` command, full backup will create every 24h
170
170
watch_backup_name_template: "shard{shard}-{type}-{time:20060102150405}"# WATCH_BACKUP_NAME_TEMPLATE, used only for `watch` command, macros values will apply from `system.macros` for time:XXX, look format in https://go.dev/src/time/format.go
171
-
171
+
172
+
# watch_schedules - WATCH_SCHEDULES, use only for `watch` command, named cron driven backup chains, mutually exclusive with watch_interval/full_interval
173
+
# `name` added as prefix to watch_backup_name_template to isolate backup chains, `full` and `increment` are cron expressions (standard 5 fields, optional leading seconds field, @every/@daily descriptors)
174
+
# `full_type: rebase` creates scheduled full backup as increment + `rebase` command (server-side copy of previous chain instead of full re-upload)
175
+
# `delete_previous_cycle: true` deletes all older backups of the chain after successful full backup
176
+
# in WATCH_SCHEDULES env variable use `name=daily,full=0 0 * * *,increment=0 * * * *;name=weekly,full=@weekly` format, `;` as separator between schedules
177
+
# watch_schedules:
178
+
# - name: daily
179
+
# full: "0 0 * * *"
180
+
# increment: "0 * * * *"
181
+
# full_type: create
182
+
# delete_previous_cycle: false
183
+
watch_schedules: []
184
+
172
185
sharded_operation_mode: none # SHARDED_OPERATION_MODE, how different replicas will shard backing up data for tables. Options are: none (no sharding), table (table granularity), database (database granularity), first-replica (on the lexicographically sorted first active replica). If left empty, then the "none" option will be set as default.
173
186
174
187
cpu_nice_priority: 15# CPU niceness priority, to allow throttling CPU intensive operation, more details https://manpages.ubuntu.com/manpages/xenial/man1/nice.1.html
@@ -549,6 +562,7 @@ You can't run watch twice with the same parameters even when `allow_parallel: tr
549
562
- Optional string query argument `watch_interval` or `watch-interval` works the same as the `--watch-interval value` CLI argument.
550
563
- Optional string query argument `full_interval` or `full-interval` works the same as the `--full-interval value` CLI argument.
551
564
- Optional string query argument `watch_backup_name_template` or `watch-backup-name-template` works the same as the `--watch-backup-name-template value` CLI argument.
565
+
- Optional string query argument `schedule` works the same as the `--schedule value` CLI argument (named cron driven backup chain in `name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false]` format, can be specified multiple times, mutually exclusive with `watch_interval`/`full_interval`).
552
566
- Optional string query argument `table` works the same as the `--table value` CLI argument (backup only selected tables).
553
567
- Optional string query argument `partitions` works the same as the `--partitions value` CLI argument (backup only selected partitions).
554
568
- Optional boolean query argument `schema` works the same as the `--schema` CLI argument (backup schema only).
@@ -1091,17 +1105,22 @@ NAME:
1091
1105
clickhouse-backup watch - Run infinite loop which create full + incremental backup sequence to allow efficient backup sequences
Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups
1111
+
Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups. Use `--schedule` instead of intervals to run backups on cron expressions
1098
1112
1099
1113
OPTIONS:
1100
1114
--config value, -c value Config 'FILE' name. (default: "/etc/clickhouse-backup/config.yml") [$CLICKHOUSE_BACKUP_CONFIG]
1101
1115
--environment-override value, --env value override any environment variable via CLI parameter
1102
1116
--watch-interval value Interval for run 'create_remote' + 'delete local' for incremental backup, look format https://pkg.go.dev/time#ParseDuration
1103
1117
--full-interval value Interval for run 'create_remote'+'delete local' when stop create incremental backup sequence and create full backup, look format https://pkg.go.dev/time#ParseDuration
1104
1118
--watch-backup-name-template value Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples
1119
+
--schedule value Named cron driven backup chain in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval
1120
+
cron expression contains standard 5 fields, optional leading seconds field and @every/@daily descriptors, see https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format
1121
+
name added as prefix to --watch-backup-name-template to isolate backup chains
1122
+
full_type=rebase creates scheduled full backup as increment + rebase command, server-side copy of previous chain instead of full re-upload
1123
+
delete_previous_cycle=true deletes all older backups of the chain after successful full backup
1105
1124
--table value, --tables value, -t value Create and upload only objects which matched with table name patterns, separated by comma, allow ? and * as wildcard
1106
1125
--partitions partition_id Partitions names, separated by comma
1107
1126
If PARTITION BY clause returns numeric not hashed values for partition_id field in system.parts table, then use --partitions=partition_id1,partition_id2 format
@@ -1142,6 +1161,7 @@ OPTIONS:
1142
1161
--watch-interval value Interval for run 'create_remote' + 'delete local' for incremental backup, look format https://pkg.go.dev/time#ParseDuration
1143
1162
--full-interval value Interval for run 'create_remote'+'delete local' when stop create incremental backup sequence and create full backup, look format https://pkg.go.dev/time#ParseDuration
1144
1163
--watch-backup-name-template value Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples
1164
+
--schedule value Named cron driven backup chain for watch in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval
1145
1165
--watch-delete-source, --watch-delete-local explicitly delete local backup during upload in watch
Description: "Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups",
Description: "Execute create_remote + delete local, create full backup every `--full-interval`, create and upload incremental backup every `--watch-interval` use previous backup as base with `--diff-from-remote` option, use `backups_to_keep_remote` config option for properly deletion remote backups, will delete old backups which not have references from other backups. Use `--schedule` instead of intervals to run backups on cron expressions",
Usage: "Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples",
823
823
Hidden: false,
824
824
},
825
+
cli.StringSliceFlag{
826
+
Name: "schedule",
827
+
Usage: "Named cron driven backup chain in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval\n"+
828
+
" cron expression contains standard 5 fields, optional leading seconds field and @every/@daily descriptors, see https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format\n"+
829
+
" name added as prefix to --watch-backup-name-template to isolate backup chains\n"+
830
+
" full_type=rebase creates scheduled full backup as increment + rebase command, server-side copy of previous chain instead of full re-upload\n"+
831
+
" delete_previous_cycle=true deletes all older backups of the chain after successful full backup",
832
+
Hidden: false,
833
+
},
825
834
cli.StringFlag{
826
835
Name: "table, tables, t",
827
836
Usage: "Create and upload only objects which matched with table name patterns, separated by comma, allow ? and * as wildcard",
@@ -910,6 +919,11 @@ func main() {
910
919
Usage: "Template for new backup name, could contain names from system.macros, {type} - full or incremental and {time:LAYOUT}, look to https://go.dev/src/time/format.go for layout examples",
911
920
Hidden: false,
912
921
},
922
+
cli.StringSliceFlag{
923
+
Name: "schedule",
924
+
Usage: "Named cron driven backup chain for watch in name=<name>,full=<cron>[,increment=<cron>][,full_type=create|rebase][,delete_previous_cycle=true|false] format, can be specified multiple times, mutually exclusive with --watch-interval and --full-interval",
0 commit comments