Redirect debug_message to temp log file
This commit is contained in:
parent
03c713d836
commit
2ffb67cc35
|
@ -44,9 +44,14 @@ HELP
|
||||||
debug_message() { # {{{
|
debug_message() { # {{{
|
||||||
|
|
||||||
local_debug_message="${1}"
|
local_debug_message="${1}"
|
||||||
|
local_temp_log="/tmp/pve.log"
|
||||||
|
|
||||||
|
if [ ! -f "${local_temp_log}" ]; then
|
||||||
|
true > "${local_temp_log}"
|
||||||
|
fi
|
||||||
|
|
||||||
## Print message if DEBUG is enable (=0)
|
## Print message if DEBUG is enable (=0)
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : ${local_debug_message}"
|
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : ${local_debug_message}" >> "${local_temp_log}"
|
||||||
|
|
||||||
unset local_debug_message
|
unset local_debug_message
|
||||||
|
|
||||||
|
@ -71,13 +76,15 @@ main() { # {{{
|
||||||
ARGS=${ARGS}
|
ARGS=${ARGS}
|
||||||
env=$(env)"
|
env=$(env)"
|
||||||
|
|
||||||
|
|
||||||
# If backup is complete {{{
|
# If backup is complete {{{
|
||||||
if [ "${phase}" = "backup-end" ]; then
|
if [ "${phase}" = "backup-end" ]; then
|
||||||
## Get TARGET's file extension
|
## Get TARGET's file extension
|
||||||
target_archive_extension="$(printf '%s' "${TARGET}" | sed -n "s/.*\.\([[:alnum:]]*\.[[:alnum:]]*\)$/\1/p")"
|
target_archive_extension="$(printf '%s' "${TARGET}" | sed -n "s/.*\.\([[:alnum:]]*\.[[:alnum:]]*\)$/\1/p")"
|
||||||
## Set path for LATEST archive file
|
## Set path for LATEST archive file
|
||||||
latest_archive="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.${target_archive_extension}"
|
latest_archive="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.${target_archive_extension}"
|
||||||
|
debug_message "backup-end − \
|
||||||
|
target_archive_extension=${target_archive_extension}
|
||||||
|
latest_archive=${latest_archive}"
|
||||||
|
|
||||||
## hardlink TARGET archive to LATEST
|
## hardlink TARGET archive to LATEST
|
||||||
debug_message "hardlink TARGET archive (${target_archive}) to \
|
debug_message "hardlink TARGET archive (${target_archive}) to \
|
||||||
|
@ -90,6 +97,8 @@ LATEST (${latest_archive})."
|
||||||
if [ "${phase}" = "log-end" ]; then
|
if [ "${phase}" = "log-end" ]; then
|
||||||
## Set path for LATEST log file
|
## Set path for LATEST log file
|
||||||
latest_log="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.log"
|
latest_log="${dumpdir}/vzdump-${vmtype}-${vmid}-latest.log"
|
||||||
|
debug_message "log-end − \
|
||||||
|
latest_log=${latest_log}"
|
||||||
|
|
||||||
## hardlink TARGET log to LATEST
|
## hardlink TARGET log to LATEST
|
||||||
debug_message "hardlink TARGET logs (${logfile}) to \
|
debug_message "hardlink TARGET logs (${logfile}) to \
|
||||||
|
|
Loading…
Reference in New Issue