forked from chroma-core/chroma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestore.sh
More file actions
42 lines (34 loc) · 1.65 KB
/
restore.sh
File metadata and controls
42 lines (34 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# #!/bin/bash
# # check to see if the docker container called chroma_clickhouse_1 is running
# if [ "$(docker inspect -f '{{.State.Running}}' chroma_clickhouse_1)" = "true" ]; then
# echo "chroma_clickhouse_1 is up, proceeding with backup"
# else
# echo "chroma_clickhouse_1 is not up"
# exit 1
# fi
# while [ $# -gt 0 ]; do
# if [[ $1 == *"--"* ]]; then
# param="${1/--/}"
# declare $param="$2"
# # echo $1 $2 // Optional to see the parameter:value result
# fi
# shift
# done
# # if backup name is not provided, exit
# if [ -z "$backup_name" ]; then
# echo "backup_name is not provided"
# exit 1
# fi
# echo $backup_name
# # change file permissions to -rw-r-----
# chmod 440 ../backups/$backup_name/$backup_name.zip
# chmod 777 ../backups/$backup_name/$backup_name.zip
# docker cp ../backups/$backup_name/index_data chroma_server_1:/
# docker cp ../backups/$backup_name/$backup_name.zip chroma_clickhouse_1:/etc/clickhouse-server/$backup_name.zip
# docker exec -u 0 -it chroma_clickhouse_1 chmod 777 /etc/clickhouse-server/$backup_name.zip
# docker exec -u 0 -it chroma_clickhouse_1 chown 1001 /etc/clickhouse-server/$backup_name.zip
# docker exec -u 0 -it chroma_clickhouse_1 chgrp root /etc/clickhouse-server/$backup_name.zip
# docker exec -u 0 -it chroma_clickhouse_1 clickhouse-client --query="DROP TABLE embeddings"
# docker exec -u 0 -it chroma_clickhouse_1 clickhouse-client --query="DROP TABLE results"
# docker exec -u 0 -it chroma_clickhouse_1 rm -rf /bitnami/clickhouse/data/tmp
# docker exec -u 0 -it chroma_clickhouse_1 clickhouse-client --query="RESTORE DATABASE default FROM Disk('backups', '$backup_name.zip')"