Skip to content

Commit

Permalink
modified: rsnapshot/rsnapshot-wrapper.sh
Browse files Browse the repository at this point in the history
	[stats] fixes

	Signed-off-by: Christian Kujau <lists@nerdbynature.de>
  • Loading branch information
ckujau committed Jul 22, 2012
1 parent b83afe5 commit a4f4b28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rsnapshot/rsnapshot-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,15 @@ case $1 in
;;

stats)
for h in `awk '/^20[0-9][0-9].*finished/ {print $5}' "$LOG" | sort -u`; do
# Not Y3K safe :-)
for h in `awk '/^2[0-9].*\((daily|weekly|monthly)\) finished/ {print $5}' "$LOG" | sort -u`; do
printf "Host $h took an average of "
egrep "${h}.*finished" "$LOG" | awk '{sum+=$9} END {print sum/NR " minutes to complete."}'
done

echo "----"
for t in hourly daily weekly monthly; do
grep -q "$t" "$LOG" || continue
grep "$t" "$LOG" > /dev/null || continue
printf "The $t backup took an average of "
egrep "${t} backup finished after" "$LOG" | awk '{sum+=$9} END {print sum/NR " minutes to complete."}'
done
Expand Down

0 comments on commit a4f4b28

Please sign in to comment.