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" CPOSTEXEC="$CDEFAULTS/post_exec"
TMP=$(mktemp /tmp/$(basename $0).XXXXXX) TMP=$(mktemp /tmp/$(basename $0).XXXXXX)
VERSION=0.3.1 VERSION=0.3.2
RELEASE="2006-XX-XX" RELEASE="2006-CHANGE-IT-THIS-TIME-NICO"
HALF_VERSION="ccollect $VERSION" HALF_VERSION="ccollect $VERSION"
FULL_VERSION="ccollect $VERSION ($RELEASE)" FULL_VERSION="ccollect $VERSION ($RELEASE)"
@ -213,7 +213,10 @@ while [ "$i" -lt "$no_shares" ]; do
c_pre_exec="$backup/pre_exec" c_pre_exec="$backup/pre_exec"
c_post_exec="$backup/post_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 # Standard configuration checks
@ -367,17 +370,27 @@ while [ "$i" -lt "$no_shares" ]; do
exit 1 exit 1
fi fi
echo "Successfully finished backup." echo "$(date) Successfully finished backup"
# #
# post_exec # post_exec
# #
if [ -x "$c_post_exec" ]; then if [ -x "$c_post_exec" ]; then
echo "Executing $c_post_exec ..." echo "$(date) Executing $c_post_exec ..."
"$c_post_exec" "$c_post_exec"
echo "Finished ${c_post_exec}." echo "$(date) Finished ${c_post_exec}."
fi 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 ) | add_name
done done

View file

@ -788,7 +788,7 @@ srwali01:/etc/ccollect/sources# du -sh /mnt/hdbackup/wl6/*
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Version 0.3.1<br /> 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>
</div> </div>
</body> </body>

View file

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