This page (revision-1) was last changed on 29-Nov-2024 16:16 by UnknownAuthor

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 75 lines
!Primary Purpose
This script does a Backup image of eDirectory DIB temporarily closing database making LDAP and eDirectory in a downed condidtion.
!Deployed Location
The [LDAPBuild Process|LDAPBuildProcess] distribute the <buildhome>[Directory-Info.com]/config/ndsbackup.sh file to /usr/bin/ndsbackup.sh
!Method of Execution
The script is run via [cron.tab|NDSCron.tab]
!Logging
The script creates a log file [/var/nds/ndsbackup.log|ConfigFilesndsbackup.log]
!Other Notable Features
The script creates a zipped files of DIB and related files for Disaster Recovery at: /var/nds/[$bkupDIR|Shared Script Variables].
Archive files located in [$bkupDIR|Shared Script Variables] older than [MTIME|Shared Script Variables] this are deleted
!Watch out for These Items
Backup image of eDirectory DIB -- temporarily closes database
Must be run with root privilages.
Typical script content as implemented is shown below.
{{{
#!/bin/bash
#:ndsbackup.sh
#
# There is no error checking, files will be overwritten, variables
# may be unassigned, ... Caveat Hackor
#
# Modification history:
# 12/03/2003--Moved functions to ndsenv_functions
# 1/20/2004 --If running as root, create $bkupDIR if it isn't already
# there
# Remove f_write_and_log commands from here, add to functions
#
# Read eDirectory installation variables and subroutines
if [ -f /var/nds/.ndsenv ]
then
. /var/nds/.ndsenv_functions
. /var/nds/.ndsenv
else
printf "\nMissing /var/nds/.ndsenv -- cannot run!\n"
exit 1
fi
EMAIL_BODY=/tmp/tmp.ndsbackup.$$ # Temp file to hold email message
##############################################################
# Override ndsenv variables
##############################################################
# The following variables should be set in /var/nds/.ndsenv; if these aren't set
# for some reason, initialize them to some good default values
PATH=$PATH:/usr/local/bin
export PATH
# User to change ownership of archive files
USER=ndsuser
# Archive files located in $bkupDIR older than this are deleted
MTIME=${MTIME:=7}
# If running as root, create $bkupDIR if it isn't already there
f_checkroot
if [ ! -d $bkupDIR ] && [ $? -eq 0 ]
then
f_cmd mkdir $bkupDIR
f_cmd chown $ndsUSER $bkupDIR
f_cmd chgrp $ndsGROUP $bkupDIR
fi
# Read command line parameter into a variable
Param=`echo $1|tr "[:lower:]" "[:upper:]"`
f_backupnds $Param
}}}