Configuring Oracle Unified Directory(OUD) Backups(optional) – Part 6

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Below I am continuation on how to configure OUD backups.
You can access the other parts here – Part 1, Part 2, Part 3, Part 4 and Part 5.

Since the migration is quite complex, I am splitting the configuration into separate parts.

This is the last post of this series – Part 6, Configuring OUD backups.

Configuring and scheduling OUD backups

First, we need to create a backup file system, Since I am working on Solaris the best approach for me is using ZFS, feel free to use what is avalble on your OS, as simple as mkdir, etc..

zfs create -o mountpoint=/ldap_backups rpool/ldap_backups
chown oud:oud /ldap_backups
mkdir -p /ldap_backups/scripts /ldap_backups/ldif /ldap_backups/full_backup /ldap_backups/info
echo password > /ldap_backups/info/pw.txt
chmod 400 /ldap_backups/info/pw.txt

Create the below ldap_backup.pl backup script.
cat /ldap_backups/scripts/ldap_backup.pl<.i>.
#!/bin/perl

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime time;
$year+=1900;
$mon+=1;

$now =  "$year-$mon-$mday\_$hour-$min-$sec\n";

## LDAP Backup of dc=domain,dc=com in an LDIF format.
my @ldap_tree_backup = ('/oud/Oracle/Middleware/Oracle_Home/asinst_1/OUD/bin/export-ldif -h localhost -p 4444 -D "cn=Directory Manager" -j /ldap_backups/info/pw.txt --includeBranch "dc=domain,dc=com" --backendID userRoot --ldifFile /ldap_backups/ldif/domain.ldif_'.$now);
my $error_code = system(@ldap_tree_backup);

print "The backup code was = $error_code\n";


## Full LDAP Backup in a DB format.
my @ldap_tree_backup = ('/oud/Oracle/Middleware/Oracle_Home/asinst_1/OUD/bin/backup --backUpAll --compress --backupDirectory=/ldap_backups/full_backup/domain.ldif_'.$now);
my $error_code = system(@ldap_tree_backup);

print "The backup code was = $error_code\n";

To schedule the backup, just add the below to your cron scheduler jobs.

## Daily LDAP ldif Backup
30 01 * * * /ldap_backups/scripts/ldap_backup.pl

## Clean-up / remove old backups (30 days).
30 01 * * * find /ldap_backups/ldif /ldap_backups/full_backup -type f -mtime +30 -exec rm {} \;

This is the final post about ODSEE and ISW => OUD and DIP.
You can access the other parts of this series here - Part 1, Part 2, Part 3, Part 4 and Part 5.

Like what you're reading? please provide feedback, any feedback is appreciated.

Leave a Reply

avatar
3000
  Subscribe  
Notify of