Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iml Backup Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Iml Backup Server
Commits
497cdbe5
Commit
497cdbe5
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
fix display of backup size
parent
8cf7170d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
storage_helper.sh
+6
-2
6 additions, 2 deletions
storage_helper.sh
with
6 additions
and
2 deletions
storage_helper.sh
+
6
−
2
View file @
497cdbe5
...
...
@@ -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
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment