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

add counters for new/ changed/ deleted fileobjects

parent adf7f500
No related branches found
No related tags found
1 merge request!113add counters for new/ changed/ deleted fileobjects
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# 2022-02-09 ah v1.2 update after changes in logging # 2022-02-09 ah v1.2 update after changes in logging
# 2022-10-07 ah v1.3 unescape regex with space to prevent "grep: warning: stray \ before white space" # 2022-10-07 ah v1.3 unescape regex with space to prevent "grep: warning: stray \ before white space"
# 2022-10-20 ah v1.4 show last backup, prune and verify # 2022-10-20 ah v1.4 show last backup, prune and verify
# 2023-09-01 ah v1.5 add counters for new/ changed/ deleted fileobjects (Restic only)
# ============================================================================== # ==============================================================================
. $(dirname $0)/jobhelper.sh . $(dirname $0)/jobhelper.sh
...@@ -142,13 +143,30 @@ else ...@@ -142,13 +143,30 @@ else
if [ $flagShowChangedFiles -ne 0 ]; then if [ $flagShowChangedFiles -ne 0 ]; then
sSearch="Args:|ElapsedTime|SourceFiles|SourceFileSize|RawDeltaSize" sSearch="Args:|ElapsedTime|SourceFiles|SourceFileSize|RawDeltaSize"
if echo "$logfile" | grep -E "(inc|auto)" >/dev/null; then if echo "$logfile" | grep -E "(inc|auto)" >/dev/null; then
sSearch="[ADM] |${sSearch}" sSearch="[+-M] |${sSearch}"
fi fi
echo ">>> Changes:" echo ">>> Changes:"
grep -E "^(${sSearch})" $logfile | cut -f 2- -d ':' grep -E "^(${sSearch})" $logfile | cut -f 2- -d ':'
echo echo
fi fi
if cat $logfile | grep restic >/dev/null; then
echo ">>> Counters:"
iModFNew=$( cat $logfile | grep -c "^+ /.*[^/]$" )
iModDNew=$( cat $logfile | grep -c "^+ /.*/$" )
iModFChange=$( cat $logfile | grep -c "^M /.*[^/]$" )
iModDChange=$( cat $logfile | grep -c "^M /.*/$" )
iModFDelete=$( cat $logfile | grep -c "^- /.*[^/]$" )
iModDDelete=$( cat $logfile | grep -c "^- /.*/$" )
printf "__COUNTERS__New: %10s files %10s dirs\n" $iModFNew $iModDNew
printf "__COUNTERS__Changed: %10s files %10s dirs\n" $iModFChange $iModDChange
printf "__COUNTERS__Deleted: %10s files %10s dirs\n" $iModFDelete $iModDDelete
echo "__PERFDATA__ |files-new=$iModFNew;;;0|files-mod=$iModFChange;;;0|files-del=$iModFDelete|dirs-new=$iModDNew;;;0|dirs-mod=$iModDChange;;;0|dirs-del=$iModDDelete"
echo
fi
echo ">>> Summary of database backup actions:" echo ">>> Summary of database backup actions:"
cat $logfile | grep '__DB__' | filterColor | cut -f 1 -d ' ' | sort -u | while read -r dbprefix cat $logfile | grep '__DB__' | filterColor | cut -f 1 -d ' ' | sort -u | while read -r dbprefix
do do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment