List Info

Thread: FDS backup_now script




FDS backup_now script
user name
2007-02-13 12:31:32
This is small backup script I wrote. Often times before minor changes I run a quick backup to be on the safe side.

It assumes an ldap instance is the same as your hostname.

bob.test.test.com
instance name=bob


#!/bin/sh
# Edward Guy Capriolo
# 2007 February 13
# Used to initiate a databackup of LDAP

#Start user edit
auth_dn="change_this"
auth_ps="change_this"
#End user edit

USER_ID=`id -u`
host_n=`hostname -s`
# Standard format 2007_02_11_02_02_01
folder_name=`date +%Y_%m_%d_%H_%M_%S`

if [ "$USER_ID" = "0" ]; then
 ;       true
else
        echo "Script must be run as root (0)"
  ;      exit 1
fi

/opt/fedora-ds/slapd-${host_n}/db2bak.pl -D "${auth_dn}"; -w "${auth_ps}"; -a /opt/fedora-ds/slapd-$/bak/${folder_name}
echo "Backup Initiated: Run tail -f /opt/fedora-ds/slapd-$/logs/errors to monitor the backup status."
exit 0

Hope this is useful.
Edward Capriolo
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )