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

fix display of backup size

parent 8cf7170d
No related branches found
No related tags found
No related merge requests found
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
#local _srv=$1 #local _srv=$1
#_getAllLogs | sort | grep "\[$_srv\]" | grep ACCEPTED | tail -1 | cut -f -2 -d " " #_getAllLogs | sort | grep "\[$_srv\]" | grep ACCEPTED | tail -1 | cut -f -2 -d " "
local tsBackupStart=
test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}"
echo $tsBackupStart echo $tsBackupStart
} }
...@@ -141,6 +142,7 @@ ...@@ -141,6 +142,7 @@
# test -r "${sStatusDir}/${sBackupClient}_end" && stat -c %Y "${sStatusDir}/${sBackupClient}_end" # test -r "${sStatusDir}/${sBackupClient}_end" && stat -c %Y "${sStatusDir}/${sBackupClient}_end"
# local _srv=$1 # local _srv=$1
# _getAllLogs | sort | grep "\[$_srv\]" | grep REMOVED | tail -1 | cut -f -2 -d " " # _getAllLogs | sort | grep "\[$_srv\]" | grep REMOVED | tail -1 | cut -f -2 -d " "
local tsBackupEnd=
test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}"
echo $tsBackupEnd echo $tsBackupEnd
} }
...@@ -149,6 +151,7 @@ ...@@ -149,6 +151,7 @@
# global string sBackupClient FQDN of current server # global string sBackupClient FQDN of current server
function _getLastBackupstatus(){ function _getLastBackupstatus(){
if [ -r "${sStatusDir}/${sBackupClient}" ]; then if [ -r "${sStatusDir}/${sBackupClient}" ]; then
local backupRc=
. "${sStatusDir}/${sBackupClient}" . "${sStatusDir}/${sBackupClient}"
echo $backupRc echo $backupRc
else else
...@@ -158,6 +161,7 @@ ...@@ -158,6 +161,7 @@
# get size of backup data from status file # get size of backup data from status file
# global string sBackupClient FQDN of current server # global string sBackupClient FQDN of current server
function _getBackupsize(){ function _getBackupsize(){
local size=
test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}"
echo $size echo $size
} }
...@@ -220,7 +224,7 @@ ...@@ -220,7 +224,7 @@
echo "# $( date """+%Y-%m-%d %H:%M:%S""" )" >> "$sTouchfile" echo "# $( date """+%Y-%m-%d %H:%M:%S""" )" >> "$sTouchfile"
echo "tsBackupEnd=$( date +%s )" >> "$sTouchfile" echo "tsBackupEnd=$( date +%s )" >> "$sTouchfile"
echo "backupRc=$_status" >> "$sTouchfile" echo "backupRc=$_status" >> "$sTouchfile"
echo "size=$( du -hs ${sBackupBasedir}/*/$sBackupClient 2>/dev/null )" >> "$sTouchfile" echo "size='$( du -hs ${sBackupBasedir}/*/$sBackupClient 2>/dev/null )'" >> "$sTouchfile"
mv "$sTouchfile" "$sStatusDir/${sBackupClient}" mv "$sTouchfile" "$sStatusDir/${sBackupClient}"
else else
echo INFO: server [$sBackupClient] had no reserved slot echo INFO: server [$sBackupClient] had no reserved slot
...@@ -283,7 +287,7 @@ ...@@ -283,7 +287,7 @@
typeset -i local iend="$( _getLastBackupend )" typeset -i local iend="$( _getLastBackupend )"
typeset -i local bIsRunning=$( _isRunning ) typeset -i local bIsRunning=$( _isRunning )
typeset -i local iLastStatus=$( _getLastBackupstatus ) typeset -i local iLastStatus=$( _getLastBackupstatus )
size=$( _getBackupsize ) local size=$( _getBackupsize )
local tstart=$( date +"%Y-%m-%d %H:%M:%S" -d @${istart} ) local tstart=$( date +"%Y-%m-%d %H:%M:%S" -d @${istart} )
local tend=$( date +"%Y-%m-%d %H:%M:%S" -d @${iend} ) local tend=$( date +"%Y-%m-%d %H:%M:%S" -d @${iend} )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment