Added backup duration information (proposed by Daniel Aubry)

This commit is contained in:
Nico Schottelius 2006-01-25 23:37:52 +01:00
parent 61201b1f6a
commit 199d81b0ef
3 changed files with 21 additions and 7 deletions

View file

@ -14,8 +14,8 @@ CPREEXEC="$CDEFAULTS/pre_exec"
CPOSTEXEC="$CDEFAULTS/post_exec"
TMP=$(mktemp /tmp/$(basename $0).XXXXXX)
VERSION=0.3.1
RELEASE="2006-XX-XX"
VERSION=0.3.2
RELEASE="2006-CHANGE-IT-THIS-TIME-NICO"
HALF_VERSION="ccollect $VERSION"
FULL_VERSION="ccollect $VERSION ($RELEASE)"
@ -213,7 +213,10 @@ while [ "$i" -lt "$no_shares" ]; do
c_pre_exec="$backup/pre_exec"
c_post_exec="$backup/post_exec"
echo "Beginning to backup this source ..."
begin=$(date)
begin_s=$(date +%s)
echo "$begin Beginning to backup"
#
# Standard configuration checks
@ -367,17 +370,27 @@ while [ "$i" -lt "$no_shares" ]; do
exit 1
fi
echo "Successfully finished backup."
echo "$(date) Successfully finished backup"
#
# post_exec
#
if [ -x "$c_post_exec" ]; then
echo "Executing $c_post_exec ..."
echo "$(date) Executing $c_post_exec ..."
"$c_post_exec"
echo "Finished ${c_post_exec}."
echo "$(date) Finished ${c_post_exec}."
fi
end_s=$(date +%s)
full_seconds=$(echo "$end_s - $begin_s" | bc -l)
hours=$(echo $full_seconds / 3600 | bc)
seconds=$(echo "$full_seconds - ($hours * 3600)" | bc)
minutes=$(echo $seconds / 60 | bc)
seconds=$(echo "$seconds - ($minutes * 60)" | bc)
echo "Backup lasted: ${hours}:$minutes:$seconds (h:m:s)"
) | add_name
done

View file

@ -788,7 +788,7 @@ srwali01:/etc/ccollect/sources# du -sh /mnt/hdbackup/wl6/*
<div id="footer">
<div id="footer-text">
Version 0.3.1<br />
Last updated 25-Jan-2006 00:12:06 CEST
Last updated 25-Jan-2006 00:15:41 CEST
</div>
</div>
</body>

View file

@ -51,6 +51,7 @@ Using ccollect
.Running ccollect requires the following tools installed:
- `bc`
- `cp` with support for hard links ('cp -al')
- `date`
- `rsync`
- `ssh` (if you want to use rsync over ssh, which is recommened for security)