On 01/10/2013 03:50 PM, Rich Megginson wrote:
On 01/10/2013 03:45 PM, Orion Poplawski wrote:


FWIW -

 Here's my current backup script (in /etc/cron.daily/dirsrv-backup). Did this:

mv /usr/lib64/dirsrv/slapd-PKI-IPA /var/lib/dirsrv/scripts-PKI-IPA
ln -s /var/lib/dirsrv/scripts-PKI-IPA /usr/lib64/dirsrv/slapd-PKI-IPA

To make the two installs similar.

I don't recommend doing that as it may break upgrades and/or cause problems
with selinux.  But YMMV.

Okay, right you are.  Here's a new script.

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                   http://www.nwra.com
#!/bin/bash
# Backup each instance
for dirsrv in /etc/dirsrv/slapd-*
do
   name=${dirsrv/*slapd-/}
   vardir=/var/lib/dirsrv/slapd-${name}
   [ -d /var/lib/dirsrv/scripts-${name} ] && 
scriptdir=/var/lib/dirsrv/scripts-${name}
   [ -d /usr/lib64/dirsrv/slapd-${name} ] && 
scriptdir=/usr/lib64/dirsrv/slapd-${name}
   [ -d /usr/lib/dirsrv/slapd-${name} ] && 
scriptdir=/usr/lib/dirsrv/slapd-${name}

   ${scriptdir}/db2bak.pl -D 'cn=Directory Manager' -j /etc/ldap.secret -a 
${vardir}/bak/${name}-`date +%Y_%m_%d_%H_%M_%S` > /dev/null
   /usr/sbin/tmpwatch -mM 240 ${vardir}/bak

   dbdir=${vardir}/db
   for dbentry in ${dbdir}/*
   do
      if [ -d ${dbentry} ]
      then
         dbname=$(basename ${dbentry})
         ${scriptdir}/db2ldif -n ${dbname} > /dev/null
      fi
   done
   /usr/sbin/tmpwatch -mM 240 ${vardir}/ldif
done
_______________________________________________
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users

Reply via email to