chiark / gitweb /
get-kernel: Only move 'linux' out of the way if it exists as a symbolic
[bin.git] / svn-backup
1 #! /bin/sh
2
3 REPOS="$1"
4 DUMP="$2"
5 OWNER="$3"
6 if [ -z "$REPOS" ] || [ -z "$DUMP" ]; then
7     echo "Usage: $0 repository dump-prefix [repository-owner]" >&2
8     exit 1
9 fi
10
11 if [ -n "$OWNER" ]; then
12     SVNADMIN="sudo -u $OWNER svnadmin"
13 else
14     SVNADMIN=svnadmin
15 fi
16
17 REV=`$SVNADMIN youngest "$REPOS"`
18 if [ "`expr "$REV" : '[0-9]\+'`" -eq 0 ]; then
19     echo "$0: svnadmin youngest failed" >&2
20     exit 1
21 fi
22
23 $SVNADMIN dump "$REPOS" 0 "$REV" > "$DUMP.$REV"
24
25 exit 0