From fc808027ca72a18a90335bde659595571129038c Mon Sep 17 00:00:00 2001 From: Slach Date: Tue, 14 Nov 2023 08:23:21 +0300 Subject: [PATCH] work related with https://github.com/Altinity/clickhouse-backup/issues/781 --- ReadMe.md | 2 +- test/integration/config-custom-kopia.yml | 2 +- test/integration/kopia/upload.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index d05d3171..534c8d0f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -592,7 +592,7 @@ For `compression_format`, a good default is `tar`, which uses less CPU. In most All custom commands use the go-template language. For example, you can use `{{ .cfg.* }}` `{{ .backupName }}` `{{ .diffFromRemote }}`. A custom `list_command` returns JSON which is compatible with the `metadata.BackupMetadata` type with [JSONEachRow](https://clickhouse.com/docs/en/interfaces/formats/#jsoneachrow) format. -For examples, see [restic](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/restic/), [rsync](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/rsync/) and [kopia](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/kopia/). Feel free to add yours too. +For examples, see [restic](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/restic/), [rsync](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/rsync/) and [kopia](https://github.com/Altinity/clickhouse-backup/tree/master/test/integration/kopia/). Feel free to add yours custom storage. ## ATTENTION! diff --git a/test/integration/config-custom-kopia.yml b/test/integration/config-custom-kopia.yml index 26b70025..8c8f1e3a 100644 --- a/test/integration/config-custom-kopia.yml +++ b/test/integration/config-custom-kopia.yml @@ -18,7 +18,7 @@ clickhouse: timeout: 5s restart_command: "sql:SYSTEM RELOAD USERS; sql:SYSTEM RELOAD CONFIG; sql:SYSTEM SHUTDOWN" custom: - # all `kopia` uploads are incremental + # all `kopia` uploads are incremental we don't need {{ .diffFromRemote }} upload_command: /custom/kopia/upload.sh {{ .backupName }} download_command: /custom/kopia/download.sh {{ .backupName }} delete_command: /custom/kopia/delete.sh {{ .backupName }} diff --git a/test/integration/kopia/upload.sh b/test/integration/kopia/upload.sh index 8ab2bd5d..46329618 100755 --- a/test/integration/kopia/upload.sh +++ b/test/integration/kopia/upload.sh @@ -12,7 +12,7 @@ fi SNAPSHOT_SOURCES="" for dir in $(echo "${LOCAL_PATHS}"); do if [[ -d "${dir}" ]]; then - upload_dir="$(dirname "${dir}")/last_upload" + upload_dir="$(dirname "${dir}")/latest" cp -rl "${dir}" "${upload_dir}" SNAPSHOT_SOURCES="${upload_dir} ${SNAPSHOT_SOURCES}" fi @@ -22,7 +22,7 @@ kopia snapshot create $DIFF_FROM_REMOTE_CMD --fail-fast --tags="backup_name:${BA for dir in $(echo "${LOCAL_PATHS}"); do if [[ -d "${dir}" ]]; then - upload_dir="$(dirname "${dir}")/last_upload" + upload_dir="$(dirname "${dir}")/latest" rm -rf "${upload_dir}" fi done