forked from ungleich-public/ccollect
Remove bc
This commit is contained in:
parent
342b5bf488
commit
d2369c1963
1 changed files with 7 additions and 7 deletions
14
ccollect.sh
14
ccollect.sh
|
@ -356,8 +356,8 @@ while [ "$i" -lt "$no_sources" ]; do
|
||||||
echo " total keeping $c_interval backup(s)."
|
echo " total keeping $c_interval backup(s)."
|
||||||
|
|
||||||
if [ "$count" -ge "$c_interval" ]; then
|
if [ "$count" -ge "$c_interval" ]; then
|
||||||
substract=$(echo $c_interval - 1 | bc)
|
substract=$((${c_interval} - 1))
|
||||||
remove=$(echo $count - $substract | bc)
|
remove=$(($count - $substract))
|
||||||
echo "Removing $remove backup(s)..."
|
echo "Removing $remove backup(s)..."
|
||||||
|
|
||||||
ls -d "$c_dest/${INTERVAL}."?* | sort -n | head -n $remove > "$TMP"
|
ls -d "$c_dest/${INTERVAL}."?* | sort -n | head -n $remove > "$TMP"
|
||||||
|
@ -440,11 +440,11 @@ while [ "$i" -lt "$no_sources" ]; do
|
||||||
|
|
||||||
end_s=$(date +%s)
|
end_s=$(date +%s)
|
||||||
|
|
||||||
full_seconds=$(echo "$end_s - $begin_s" | bc -l)
|
full_seconds=$((${end_s} - ${begin_s}))
|
||||||
hours=$(echo $full_seconds / 3600 | bc)
|
hours=$(($full_seconds / 3600))
|
||||||
seconds=$(echo "$full_seconds - ($hours * 3600)" | bc)
|
seconds=$(($full_seconds - ($hours * 3600)))
|
||||||
minutes=$(echo $seconds / 60 | bc)
|
minutes=$(($seconds / 60))
|
||||||
seconds=$(echo "$seconds - ($minutes * 60)" | bc)
|
seconds=$((${seconds} - (${minutes} * 60)))
|
||||||
|
|
||||||
echo "Backup lasted: ${hours}:${minutes}:${seconds} (h:m:s)"
|
echo "Backup lasted: ${hours}:${minutes}:${seconds} (h:m:s)"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue