post_commit.sh
#!/bin/bash
ROOT=`cd $(dirname $0); pwd`
HOOKS=$ROOT/hooks
HOST=svn://192.168.20.153/repos1
SLAVE=svn://192.168.20.167/repos1
USERNAME=laiyuzhou
PASSWORD=laiyuzhou
DESTINATION=post-commit
var=$(whereis svnsync)
echo $var
SVNSYNC=$(echo $var | awk '{printf $NF}')
var="$SVNSYNC sync --non-interactive $SLAVE $HOST --username $USERNAME --password $PASSWORD"
echo -e '#!/bin/bash \n'$var'' > $HOOKS/$DESTINATION
chmod 755 $HOOKS/$DESTINATION