diff options
author | Leonard Kugis <leonard@kug.is> | 2025-04-11 23:22:21 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-04-11 23:22:21 +0200 |
commit | 5575ed931b95bb1f4a041c9fc41790ad02911b88 (patch) | |
tree | b8de8b361190a60a956c5772e2e4257bd7aa584f /backup.sh | |
parent | fa7da1e36bebcfdd96116a173275d51b2d860223 (diff) | |
download | scripts-5575ed931b95bb1f4a041c9fc41790ad02911b88.tar.gz |
backup: Moved secrets to config
Diffstat (limited to 'backup.sh')
-rw-r--r-- | backup.sh | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -5,11 +5,13 @@ BASE_DIR="/root/scripts" CONFIG_JSON="${BASE_DIR}/config.json" -BACKUPDIR=$(jq -r '.backup.backup_dir' "$CONFIG_JSON") -ROTATEDIR=$(jq -r '.backup.rotate_dir' "$CONFIG_JSON") -TIMESTAMP=$(jq -r '.backup.timestamp_file' "$CONFIG_JSON") -SOURCE_FILE=$(jq -r '.backup.source_file' "$CONFIG_JSON") -EXCLUDE_FILE=$(jq -r '.backup.exclude_file' "$CONFIG_JSON") +JSON_PREFIX="backup" + +BACKUPDIR=$(jq -r '.${JSON_PREFIX}.backup_dir' "$CONFIG_JSON") +ROTATEDIR=$(jq -r '.${JSON_PREFIX}.rotate_dir' "$CONFIG_JSON") +TIMESTAMP=$(jq -r '.${JSON_PREFIX}.timestamp_file' "$CONFIG_JSON") +SOURCE_FILE=$(jq -r '.${JSON_PREFIX}.source_file' "$CONFIG_JSON") +EXCLUDE_FILE=$(jq -r '.${JSON_PREFIX}.exclude_file' "$CONFIG_JSON") DATUM="$(date +%Y-%m-%d)" ZEIT="$(date +%H-%M-%S-%N)" |