From b801c2c002d92a2b9ff3a37385d6cc33c10e5397 Mon Sep 17 00:00:00 2001 From: Tomi Eckert Date: Mon, 6 Oct 2025 11:22:59 +0200 Subject: [PATCH] feat(backup): Introduce backup hook script and adjust configuration --- backup/backup.conf | 6 +++--- backup/backup.hook.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 backup/backup.hook.sh diff --git a/backup/backup.conf b/backup/backup.conf index a0a1595..91e30bb 100644 --- a/backup/backup.conf +++ b/backup/backup.conf @@ -12,21 +12,21 @@ HDBSQL_PATH="/usr/sap/hdbclient/hdbsql" USER_KEY="CRONKEY" # hdbuserstore key for the SYSTEMDB user -SYSTEMDB_USER_KEY="SYSTEMDB_KEY" +SYSTEMDB_USER_KEY="SYSTEMKEY" # --- Backup Settings --- # The base directory where all backup files and directories will be stored. # Ensure this directory exists and that the OS user running the script has # write permissions to it. -BACKUP_BASE_DIR="/hana/backups/automated" +BACKUP_BASE_DIR="/hana/shared/backup" # Specify the type of backup to perform on script execution. # Options are: # 'schema' - Performs only the schema export. # 'tenant' - Performs only the tenant data backup. # 'all' - Performs both the schema export and the tenant backup. -BACKUP_TYPE="all" +BACKUP_TYPE="tenant" # Set to 'true' to also perform a backup of the SYSTEMDB BACKUP_SYSTEMDB=true diff --git a/backup/backup.hook.sh b/backup/backup.hook.sh new file mode 100644 index 0000000..bef6560 --- /dev/null +++ b/backup/backup.hook.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# This script helps to configure backup.conf + +# Source the backup.conf to get current values +source backup.conf + +HDBSQL_PATH_INPUT=$(which hdbsql) + +# Default values if not found +HDBSQL_PATH_INPUT=${HDBSQL_PATH_INPUT:-"/usr/sap/hdbclient/hdbsql"} + +# Update backup.conf +sed -i "s#^HDBSQL_PATH=\".*\"#HDBSQL_PATH=\"$HDBSQL_PATH_INPUT\"#" backup.conf + +echo "backup.conf updated successfully!" \ No newline at end of file