From 5905aed39e6fdaef2dda1fb8dc2ead5993935aa5 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 27 Aug 2023 17:05:59 +0200 Subject: [PATCH] fix: backup script issue --- files/vault-backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/vault-backup.sh b/files/vault-backup.sh index e7e0fba..534e153 100755 --- a/files/vault-backup.sh +++ b/files/vault-backup.sh @@ -3,6 +3,7 @@ export PATH_DIR="daily" export PATH_BACKUP=$PATH_SNAPSHOT"/"$PATH_DIR export VAULT_APPROLEID=$2 export VAULT_SECRETID=$3 +export VAULT_ADDR="http://active.vault.service.consul:8200" export RETENTION=30 export ENV="0" # (0 = staging, 1 = production) export SNAPSHOT_FILE=$(date +%Y-%m-%d) @@ -13,7 +14,7 @@ create_snapshot_folder(){ } run_snapshot() { - VAULT_TOKEN=$(/usr/bin/vault write -field=token auth/approle/login role_id=$VAULT_APPROLEID secret_id=$VAULT_SECRETID) + export VAULT_TOKEN=$(/usr/bin/vault write -field=token auth/approle/login role_id=$VAULT_APPROLEID secret_id=$VAULT_SECRETID) /usr/bin/vault operator raft snapshot save $PATH_BACKUP/$SNAPSHOT_FILE.snap }