Skip to content

Commit

Permalink
work related with #781
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Nov 14, 2023
1 parent e469de9 commit fc80802
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
2 changes: 1 addition & 1 deletion test/integration/config-custom-kopia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/kopia/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fc80802

Please sign in to comment.