feat(backup): added thread to config

This commit is contained in:
2026-01-19 11:28:33 +01:00
parent 5579fc852f
commit 2c4c03e604
3 changed files with 15 additions and 1 deletions

View File

@@ -37,6 +37,9 @@ COMPRESS_SCHEMA=true
# for a 40GB tenant. # for a 40GB tenant.
COMPRESS_TENANT=true COMPRESS_TENANT=true
# Number of threads to use for schema export.
THREADS=1
# --- Target Identifiers --- # --- Target Identifiers ---
# The name of the schema to be exported when BACKUP_TYPE is 'schema' or 'all'. # The name of the schema to be exported when BACKUP_TYPE is 'schema' or 'all'.

View File

@@ -11,7 +11,12 @@ HDBSQL_PATH_INPUT=$(which hdbsql)
# Default values if not found # Default values if not found
HDBSQL_PATH_INPUT=${HDBSQL_PATH_INPUT:-"/usr/sap/hdbclient/hdbsql"} HDBSQL_PATH_INPUT=${HDBSQL_PATH_INPUT:-"/usr/sap/hdbclient/hdbsql"}
# Calculate default threads (half of available)
TOTAL_THREADS=$(nproc --all)
THREADS_DEFAULT=$((TOTAL_THREADS / 2))
# Update backup.conf # Update backup.conf
sed -i "s#^HDBSQL_PATH=\".*\"#HDBSQL_PATH=\"$HDBSQL_PATH_INPUT\"#" backup.conf sed -i "s#^HDBSQL_PATH=\".*\"#HDBSQL_PATH=\"$HDBSQL_PATH_INPUT\"#" backup.conf
sed -i "s#^THREADS=.\"*\"#THREADS=\"$THREADS_DEFAULT\"#" backup.conf
echo "backup.conf updated successfully!" echo "backup.conf updated successfully!"

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 1.0.8 # Version: 1.1.0
# Author: Tomi Eckert # Author: Tomi Eckert
# ============================================================================== # ==============================================================================
# SAP HANA Backup Script # SAP HANA Backup Script
@@ -47,6 +47,9 @@ case "$BACKUP_TYPE" in
for schema in $SCHEMA_NAMES; do for schema in $SCHEMA_NAMES; do
echo "⬇️ Starting schema export for '${schema}'..." echo "⬇️ Starting schema export for '${schema}'..."
SCHEMA_EXPORT_OPTIONS="$COMMON_OPTIONS" SCHEMA_EXPORT_OPTIONS="$COMMON_OPTIONS"
if [[ -n "$THREADS" ]]; then
SCHEMA_EXPORT_OPTIONS+=" -t $THREADS"
fi
if [[ "$COMPRESS_SCHEMA" == "true" ]]; then if [[ "$COMPRESS_SCHEMA" == "true" ]]; then
SCHEMA_EXPORT_OPTIONS+=" --compress" SCHEMA_EXPORT_OPTIONS+=" --compress"
fi fi
@@ -77,6 +80,9 @@ case "$BACKUP_TYPE" in
for schema in $SCHEMA_NAMES; do for schema in $SCHEMA_NAMES; do
echo "⬇️ Starting schema export for '${schema}'..." echo "⬇️ Starting schema export for '${schema}'..."
SCHEMA_EXPORT_OPTIONS="$COMMON_OPTIONS" SCHEMA_EXPORT_OPTIONS="$COMMON_OPTIONS"
if [[ -n "$THREADS" ]]; then
SCHEMA_EXPORT_OPTIONS+=" -t $THREADS"
fi
if [[ "$COMPRESS_SCHEMA" == "true" ]]; then if [[ "$COMPRESS_SCHEMA" == "true" ]]; then
SCHEMA_EXPORT_OPTIONS+=" --compress" SCHEMA_EXPORT_OPTIONS+=" --compress"
fi fi