FDS backup_now script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-${host_n}/bak/${folder_name}
echo "Backup Initiated: Run tail -f /opt/fedora-ds/slapd-${host_n}/logs/errors to monitor the backup status."
exit 0

Hope this is useful.
Edward Capriolo
--
Fedora-directory-users mailing list
Fedora-directory-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users

[Index of Archives]     [Fedora Directory Users]     [Fedora Directory Devel]     [Fedora Announce]     [Fedora Legacy Announce]     [Kernel]     [Fedora Legacy]     [Share Photos]     [Fedora Desktop]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux