Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Liberate
backupninja
Commits
4924d343
Commit
4924d343
authored
19 years ago
by
micah
Browse files
Options
Downloads
Patches
Plain Diff
Added enhanced options to ldap handler
parent
0528f46c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
backupninja
+1
-0
1 addition, 0 deletions
backupninja
changelog
+5
-0
5 additions, 0 deletions
changelog
etc/backup.d/example.ldap
+23
-0
23 additions, 0 deletions
etc/backup.d/example.ldap
handlers/ldap
+31
-9
31 additions, 9 deletions
handlers/ldap
with
60 additions
and
9 deletions
backupninja
+
1
−
0
View file @
4924d343
...
...
@@ -402,6 +402,7 @@ defaultwhen=$when
getconf logfile /var/log/backupninja.log
getconf usecolors
"yes"
getconf SLAPCAT /usr/sbin/slapcat
getconf LDAPSEARCH /usr/bin/ldapsearch
getconf RDIFFBACKUP /usr/bin/rdiff-backup
getconf MYSQL /usr/bin/mysql
getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy
...
...
This diff is collapsed.
Click to expand it.
changelog
+
5
−
0
View file @
4924d343
version 0.x -- xxxxxxxxxxxxx
ldap handler has new options: backup method to use (ldapsearch or
slapcat), restart, passwordfile and binddn. Default backup method
is set to ldapsearch as this is safer
version 0.5 -- April 12 2005
rdiff handler works when remote sshd has a banner
rdiff handler supports local dest
...
...
This diff is collapsed.
Click to expand it.
etc/backup.d/example.ldap
+
23
−
0
View file @
4924d343
...
...
@@ -18,3 +18,26 @@
## compress (default yes): if set to yes, ldif exports are gzipped.
# compress = yes
## restart (default no): if set to yes, slapd is restarted before backups are
## performed, and then started again after they have finished, this is necessary
## if your backend is ldbm and your method is slapcat, but unnecessary otherwise
# restart = no
## method (default ldapsearch): either 'ldapsearch' or 'slapcat'
## ldapsearch is the safer method to do backups, but is slow, slapcat
## is much faster, but should not be done on an ldbm backend unless you have
## restart set to yes
# method = ldapsearch
## passwordfile (no default): this should be set to the file that contains
## your ldap password, this is required for ldapsearch and not needed for slapcat
## this file should have no newlines in it, echo -n "password" > passfile works.
## NOTE: be sure to set the permissions on your password file appropriately
## (hint: world readable is not appropriate)
# passwordfile =
## binddn (no default): set this to the DN of the user that the ldapsearch binds
## to, not needed for slapcat
# binddn =
This diff is collapsed.
Click to expand it.
handlers/ldap
+
31
−
9
View file @
4924d343
...
...
@@ -7,9 +7,10 @@ getconf conf /etc/ldap/slapd.conf
getconf databases all
getconf compress yes
getconf ldif yes
getconf hotcopy no
# hot copy is not yet supported
getconf restart no
getconf method ldapsearch
getconf passwordfile
getconf binddn
status="ok"
...
...
@@ -42,18 +43,39 @@ if [ "$ldif" == "yes" ]; then
if [ "$dbsuffix" == "" ]; then
continue;
fi
touch $dumpdir/$dbsuffix.ldif
if [ ! -f $dumpdir/$dbsuffix.ldif ]; then
fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif"
if [ "$method" == "slapcat" ]; then
execstr="$SLAPCAT -f $conf -b $dbsuffix"
if [ "$restart" == "yes" ]; then
debug "Shutting down ldap server..."
/etc/init.d/slapd stop
fi
debug "$execstr"
else
execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
[ -f "$passwordfile" ] || fatal "Password file $passwordfile not found"
if [ "$restart" == "yes" ]; then
debug "Shutting down ldap server..."
/etc/init.d/slapd stop
fi
debug "$execstr"
fi
execstr="$SLAPCAT -f $conf -b $dbsuffix -l $dumpdir/$dbsuffix.ldif"
debug "$execstr"
if [ ! $test ]; then
output=`$execstr`
touch $dumpdir/$dbsuffix.ldif
if [ ! -f $dumpdir/$dbsuffix.ldif ]; then
fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif"
fi
output=`$execstr > $dumpdir/$dbsuffix.ldif`
code=$?
if [ "$code" == "0" ]; then
debug $output
info "Successfully finished ldif export of $dbsuffix"
if [ "$restart" == "yes" ]; then
debug "Starting ldap server..."
/etc/init.d/slapd start
fi
else
warning $output
warning "Failed ldif export of $dbsuffix"
...
...
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