Skip to content

Commit

Permalink
functions: add run_headless_dbcheck and run_query commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsura authored and BareosBot committed May 29, 2024
1 parent 4079345 commit 921de62
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions systemtests/scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,24 @@ run_bscan_db()
run_bscan -n "$db_name" -u "$db_user" -P "$db_password" "$@"
}

run_query()
{
# hope that no pw is set
print_debug "run query $*"
PGOPTIONS="--client-min-messages=warning" psql -d "${db_name}" -q -c "$@"
}

run_headless_dbcheck()
{
print_debug "checking with ${BAREOS_DBCHECK_BINARY}"
if test "$debug" -eq 1 ; then
"${BAREOS_DBCHECK_BINARY}" "${working_dir}" "${db_name}" "${db_user}" "${db_password}" --verbose -d 500 "$@" | tee "${tmp}/dbcheck.out"
else
"${BAREOS_DBCHECK_BINARY}" "${working_dir}" "${db_name}" "${db_user}" "${db_password}" -b "$@" >"${tmp}/dbcheck.out" 2>&1
fi
}


run_bcopy()
{
print_debug "bcopying with ${BAREOS_BCOPY_BINARY}"
Expand Down

0 comments on commit 921de62

Please sign in to comment.