We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 322f7de commit 3067394Copy full SHA for 3067394
addons/elasticsearch/dataprotection/backup.sh
@@ -11,6 +11,19 @@ toolConfig=/etc/datasafed/datasafed.conf
11
REPOSITORY=kb-backup
12
ES_ENDPOINT=http://${DP_DB_HOST}.${KB_NAMESPACE}.svc.cluster.local:9200
13
14
+# if the script exits with a non-zero exit code, touch a file to indicate that the backup failed,
15
+# the sync progress container will check this file and exit if it exists
16
+function handle_exit() {
17
+ exit_code=$?
18
+ if [ $exit_code -ne 0 ]; then
19
+ echo "failed with exit code $exit_code"
20
+ touch "${DP_BACKUP_INFO_FILE}.exit"
21
+ exit 1
22
+ else
23
+ echo "{}" >"${DP_BACKUP_INFO_FILE}"
24
+ exit 0
25
+ fi
26
+}
27
trap handle_exit EXIT
28
29
function getToolConfigValue() {
0 commit comments