mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit 33ce851cb8ff9e413126cae2d8bb645263530e9f
parent 6161791b9ac81b73963989b220e81645d1047c70
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Mon, 14 Jan 2019 11:29:54 +0100

synchronize local backup of all mr svn repos

Diffstat:
svnsync-myrepos | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/svnsync-myrepos b/svnsync-myrepos @@ -0,0 +1,26 @@ +#!/bin/bash + +# synchronizes a local backup of all my svn repositories +# $1 is the destination of the backup +# ASSUMPTION: all the svn repositories live in ~/svn/* + +set -e + +DEST=$(realpath "$1") + +ls ~/svn | while read repos +do + cd "$HOME/svn/$repos" + URL=$(svn info | grep '^URL:' | cut -d' ' -f2) + cd "$DEST" + LDEST="file://$DEST/$repos" + if [ ! -d "$DEST/$repos" ] + then + # https://stackoverflow.com/a/2303862 + svnadmin create "$repos" + echo -ne '#!/bin/sh\nexit 0' > "$repos/hooks/pre-revprop-change" + chmod ugo+x "./$repos/hooks/pre-revprop-change" + svnsync init "$LDEST" "$URL" + fi + svnsync sync "$LDEST" +done