diff options
author | Gunnar Wrobel <wrobel@gentoo.org> | 2004-09-16 11:28:28 +0000 |
---|---|---|
committer | Gunnar Wrobel <wrobel@gentoo.org> | 2004-09-16 11:28:28 +0000 |
commit | 5b7064c4b4773aa5d87f53497fbca47d51cbccb2 (patch) | |
tree | 3a3f0bf12e85adb270be9bf3a428da8582422ab1 /z-distfiles/scripts-gw-1.0/SVN-ldap | |
parent | Finished restructuring the ebuilds (diff) | |
download | misc-5b7064c4b4773aa5d87f53497fbca47d51cbccb2.tar.gz misc-5b7064c4b4773aa5d87f53497fbca47d51cbccb2.tar.bz2 misc-5b7064c4b4773aa5d87f53497fbca47d51cbccb2.zip |
scripts
svn path=/z-distfiles/; revision=46
Diffstat (limited to 'z-distfiles/scripts-gw-1.0/SVN-ldap')
-rwxr-xr-x | z-distfiles/scripts-gw-1.0/SVN-ldap | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/z-distfiles/scripts-gw-1.0/SVN-ldap b/z-distfiles/scripts-gw-1.0/SVN-ldap new file mode 100755 index 0000000..7ee7681 --- /dev/null +++ b/z-distfiles/scripts-gw-1.0/SVN-ldap @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ "x$1" == "x--help" ]; then + echo "Usage: SVN-ldap /backup/dir \"commit message\"" + echo + echo "Dumps all mysql databases into the given /backup/dir/ldap" + echo "and subsequently performs a \"svn commit\". So the " + echo "backup dir has to be a checkout from an svn repository." + exit 0 +fi + +LOGFILE=${1}/cronlog +ERRFILE=${1}/errlog +BASEDIR=${1}/ldap/ + +if [ ! -d "${BASEDIR}" ]; then + mkdir -p $BASEDIR + cd ${1} && svn add ldap +fi + +date > $LOGFILE +date > $ERRFILE + +slapcat > $BASEDIR/ldap.dump + +MESSAGE="$2" +[ ! "$MESSAGE" ] && MESSAGE="Automatic Update" +cd $BASEDIR >> $LOGFILE 2>> $ERRFILE && svn commit -m "$MESSAGE" >> $LOGFILE 2>> $ERRFILE + +cat $LOGFILE +cat $ERRFILE + +rm $LOGFILE +rm $ERRFILE |