mirror of
https://github.com/deajan/obackup.git
synced 2024-12-26 15:33:41 +01:00
Logs sent per mail are now only limited to current run
This commit is contained in:
parent
8817c68f7c
commit
bf8e45217c
@ -28,6 +28,9 @@ fi
|
|||||||
ERROR_ALERT=0
|
ERROR_ALERT=0
|
||||||
WARN_ALERT=0
|
WARN_ALERT=0
|
||||||
|
|
||||||
|
# Current log
|
||||||
|
CURRENT_LOG
|
||||||
|
|
||||||
## allow function call checks #__WITH_PARANOIA_DEBUG
|
## allow function call checks #__WITH_PARANOIA_DEBUG
|
||||||
if [ "$_PARANOIA_DEBUG" == "yes" ];then #__WITH_PARANOIA_DEBUG
|
if [ "$_PARANOIA_DEBUG" == "yes" ];then #__WITH_PARANOIA_DEBUG
|
||||||
_DEBUG=yes #__WITH_PARANOIA_DEBUG
|
_DEBUG=yes #__WITH_PARANOIA_DEBUG
|
||||||
@ -89,6 +92,7 @@ function _Logger {
|
|||||||
local evalue="${3}" # What to log to stderr
|
local evalue="${3}" # What to log to stderr
|
||||||
|
|
||||||
echo -e "$lvalue" >> "$LOG_FILE"
|
echo -e "$lvalue" >> "$LOG_FILE"
|
||||||
|
CURRENT_LOG="$CURRENT_LOG"$'\n'"$lvalue"
|
||||||
|
|
||||||
if [ "$_LOGGER_STDERR" -eq 1 ]; then
|
if [ "$_LOGGER_STDERR" -eq 1 ]; then
|
||||||
cat <<< "$evalue" 1>&2
|
cat <<< "$evalue" 1>&2
|
||||||
@ -256,8 +260,8 @@ function SendAlert {
|
|||||||
else
|
else
|
||||||
mail_no_attachment=0
|
mail_no_attachment=0
|
||||||
fi
|
fi
|
||||||
#TODO(low): Change tail -n 50 to end of fil up to last script begin
|
body="$MAIL_ALERT_MSG"$'\n\n'"$CURRENT_LOG"
|
||||||
body="$MAIL_ALERT_MSG"$'\n\n'$(tail -n 50 "$LOG_FILE")
|
|
||||||
if [ $ERROR_ALERT -eq 1 ]; then
|
if [ $ERROR_ALERT -eq 1 ]; then
|
||||||
subject="Error alert for $INSTANCE_ID"
|
subject="Error alert for $INSTANCE_ID"
|
||||||
elif [ $WARN_ALERT -eq 1 ]; then
|
elif [ $WARN_ALERT -eq 1 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user