fix exit code and output to stderr in backup-cron command

This commit is contained in:
2026-08-22 05:09:15 +02:00
parent 8f83861965
commit d1791cfcc8
+3 -2
View File
@@ -273,7 +273,7 @@ else
! which -s jq && echo "Error: jq executable not found!" >&2 && exit 200 ! which -s jq && echo "Error: jq executable not found!" >&2 && exit 200
fi fi
export PBS_REPOSITORY="$PBS_USER@${PBS_SERVER:-8007}:$PBS_DATASTORE" export PBS_REPOSITORY="$PBS_USER@$PBS_SERVER:$PBS_DATASTORE"
export PBS_PASSWORD="$PBS_PASSWORD" export PBS_PASSWORD="$PBS_PASSWORD"
case "$action" in case "$action" in
@@ -283,7 +283,8 @@ case "$action" in
backup-cron) backup-cron)
output=$(pbc-backup 2>&1) output=$(pbc-backup 2>&1)
rc=$? rc=$?
(( $rc != 0 )) && echo "$output" (( rc != 0 )) && echo "$output" >&2
exit $rc
;; ;;
list) list)
pbc-list "${args[@]}" || exit $? pbc-list "${args[@]}" || exit $?