Skip to content
Snippets Groups Projects
Commit 29857b36 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

transfer.sh: update logging (ticket 5055)

parent 4130ad17
No related branches found
No related tags found
1 merge request!385046 finetune restic params
......@@ -29,6 +29,7 @@
# 2021-01-29 ah,ds, v1.12 abort on empty passphrase
# 2021-05-19 ah,ds, v2.0 plugin driven to support multiple backup tools (duplicity + restic)
# 2021-12-02 ah v2.1 added parameter "prune" to cleanup only
# 2022-02-10 ah v2.2 update logging (removing tee)
# ================================================================================
......@@ -130,14 +131,16 @@
if [ "$1" = "prune" ]; then
doBackup=0
fi
exec 1> >( tee -a "$transferlog" ) 2>&1
echo "INFO: Start logging into $transferlog"
h1 `date` TRANSFER LOCAL DATA TO STORAGE | tee -a $transferlog
h1 `date` TRANSFER LOCAL DATA TO STORAGE
echo "METHOD : $METHOD" | tee -a $transferlog
echo "TARGET : ${STORAGE_BASEDIR}" | tee -a $transferlog
echo "REGISTER : ${STORAGE_REGISTER}" | tee -a $transferlog
echo "TOOL : $STORAGE_BIN" | tee -a $transferlog
echo | tee -a $transferlog
echo "METHOD : $METHOD"
echo "TARGET : ${STORAGE_BASEDIR}"
echo "REGISTER : ${STORAGE_REGISTER}"
echo "TOOL : $STORAGE_BIN"
echo
. `dirname $0`/plugins/transfer/$STORAGE_BIN.sh || exit 1
test -z "$STORAGE_REGISTER" || . `dirname $0`/plugins/register/$STORAGE_REGISTER.sh || exit 1
......@@ -242,7 +245,7 @@
sleep $iRnd
fi
done
fi | tee -a $transferlog
fi
h2 "`date` PRE transfer tasks"
......@@ -345,7 +348,7 @@
echo $rc > ${rcfile}
exit $rc
) | tee -a $transferlog
)
# rc=${PIPESTATUS[0]}
rc=`cat ${rcfile}`
......@@ -364,22 +367,22 @@
echo "SKIP"
else
unregisterBackupSlot `hostname -f` $rc
fi | tee -a $transferlog
fi
h2 "`date` Backup finished"
echo STATUS $0 exit with final returncode rc=$rc | tee -a $transferlog
echo | tee -a $transferlog
echo STATUS $0 exit with final returncode rc=$rc
echo
if [ $rc -eq 0 ]; then
color ok
echo Backup OK | tee -a $transferlog
echo Backup OK
else
color error
echo Backup FAILED :-/ | tee -a $transferlog
echo Backup FAILED :-/
fi
color reset
echo | tee -a $transferlog
echo
typeset -i TIMER_TRANSFER=`date +%s`-$TIMER_TRANSFER_START
echo `date` TRANSFER DONE in $TIMER_TRANSFER sec | tee -a $transferlog
echo `date` TRANSFER DONE in $TIMER_TRANSFER sec
ls -l $transferlog
exit $rc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment