blob: 7ee768152de5e559205f4aca769cd308b0b9e8af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
|