Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-openldap
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
et-public
docker-openldap
Commits
d9bae1af
Commit
d9bae1af
authored
3 years ago
by
Xueshan Feng
Browse files
Options
Downloads
Patches
Plain Diff
Update with more precise information why restore is happened.
parent
a5d91b0b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
start.sh
+13
-9
13 additions, 9 deletions
start.sh
with
13 additions
and
9 deletions
start.sh
+
13
−
9
View file @
d9bae1af
...
...
@@ -46,15 +46,19 @@ function mdb_load() {
echo
"Latest mdb file in backup:
$bakData
"
# Restore data and config if LDAP_FORCE_RESTORE is true or newer backup exists or size is smaller then usual.
echo
"Comparing timestamps of
$bakData
and
${
LDAP_MDB_DIR
}
/data.mdb"
if
[[
${
LDAP_FORCE_RESTORE
}
=
"true"
]]
||
[[
${
bakData
}
-nt
${
LDAP_MDB_DIR
}
/data.mdb
]]
\
||
du
-sh
${
LDAP_MDB_DIR
}
/data.mdb |
grep
-q
'M'
;
then
if
[[
${
LDAP_FORCE_RESTORE
}
=
"true"
]]
;
then
echo
"Force restore from
${
bakData
}
"
else
du
-sh
${
LDAP_MDB_DIR
}
/data.mdb
echo
-e
"
\n
Loading most recent data and config..."
fi
RESTORE
=
"false"
if
[[
${
LDAP_FORCE_RESTORE
}
=
"true"
]]
;
then
echo
"Force restore flag is on."
RESTORE
=
"true"
elif
[[
-f
${
LDAP_MDB_DIR
}
/data.mdb
]]
&&
[[
${
bakData
}
-nt
${
LDAP_MDB_DIR
}
/data.mdb
]]
;
then
echo
"
${
LDAP_MDB_DIR
}
/data.mdb is newer."
RESTORE
=
"true"
elif
[[
-f
${
LDAP_MDB_DIR
}
/data.mdb
]]
&&
du
-sh
${
LDAP_MDB_DIR
}
/data.mdb |
grep
-q
'M'
;
then
echo
"
$(
du
-sh
${
LDAP_MDB_DIR
}
/data.mdb
)
size is too small."
RESTORE
=
"true"
fi
if
[[
${
RESTORE
}
=
"true"
]]
;
then
echo
-e
"
\n
Loading most recent data and config from
${
bakData
}
..."
find
${
LDAP_MDB_DIR
}
-type
f
-name
'*.mdb'
-delete
stat
--format
"Restoring snapshot '%n' modified on %y"
${
bakData
}
cp
-v
${
bakData
}
${
LDAP_MDB_DIR
}
/data.mdb
...
...
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