diff --git a/storage_helper.sh b/storage_helper.sh index be90081765a47b4d3755496430058a039fbfae5f..cbcda54c9d33248ed05457436ddf8fede6e95410 100755 --- a/storage_helper.sh +++ b/storage_helper.sh @@ -131,6 +131,7 @@ #local _srv=$1 #_getAllLogs | sort | grep "\[$_srv\]" | grep ACCEPTED | tail -1 | cut -f -2 -d " " + local tsBackupStart= test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" echo $tsBackupStart } @@ -141,6 +142,7 @@ # test -r "${sStatusDir}/${sBackupClient}_end" && stat -c %Y "${sStatusDir}/${sBackupClient}_end" # local _srv=$1 # _getAllLogs | sort | grep "\[$_srv\]" | grep REMOVED | tail -1 | cut -f -2 -d " " + local tsBackupEnd= test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" echo $tsBackupEnd } @@ -149,6 +151,7 @@ # global string sBackupClient FQDN of current server function _getLastBackupstatus(){ if [ -r "${sStatusDir}/${sBackupClient}" ]; then + local backupRc= . "${sStatusDir}/${sBackupClient}" echo $backupRc else @@ -158,6 +161,7 @@ # get size of backup data from status file # global string sBackupClient FQDN of current server function _getBackupsize(){ + local size= test -r "$sStatusDir/${sBackupClient}" && . "$sStatusDir/${sBackupClient}" echo $size } @@ -220,7 +224,7 @@ echo "# $( date """+%Y-%m-%d %H:%M:%S""" )" >> "$sTouchfile" echo "tsBackupEnd=$( date +%s )" >> "$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}" else echo INFO: server [$sBackupClient] had no reserved slot @@ -283,7 +287,7 @@ typeset -i local iend="$( _getLastBackupend )" typeset -i local bIsRunning=$( _isRunning ) typeset -i local iLastStatus=$( _getLastBackupstatus ) - size=$( _getBackupsize ) + local size=$( _getBackupsize ) local tstart=$( date +"%Y-%m-%d %H:%M:%S" -d @${istart} ) local tend=$( date +"%Y-%m-%d %H:%M:%S" -d @${iend} )