Skip to content

Commit 6c31c01

Browse files
committed
Refactor ClickHouse restore script to improve logging and clarify backup restoration process
- Updated logging to indicate the restoration attempt from a specific backup file. - Removed the file existence check due to limitations with Hetzner's restricted shell, noting that SCP will fail if the file does not exist.
1 parent 013e121 commit 6c31c01

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

clickhouse/restore-clickhouse.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,9 @@ check_backup_exists() {
112112
local backup_date="$1"
113113
local backup_file="clickhouse-backup-${backup_date}.tar"
114114

115-
log "Checking if backup exists: ${BACKUP_BASE_DIR}/${backup_file}"
116-
if ! ssh "$STORAGE_BOX_HOST" "test -f ${BACKUP_BASE_DIR}/${backup_file}"; then
117-
error "Backup not found: ${backup_file}"
118-
fi
119-
120-
log "Backup found: ${backup_file}"
115+
log "Will attempt to restore from: ${BACKUP_BASE_DIR}/${backup_file}"
116+
# Note: We can't easily check file existence with Hetzner's restricted shell
117+
# SCP will fail with a clear error if the file doesn't exist
121118
}
122119

123120
# Stop ClickHouse container (if it exists)

0 commit comments

Comments
 (0)