summaryrefslogtreecommitdiff
blob: e5915521afefc82da4a9e67f033f33c3a999eccb (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
#!/bin/bash

if [ "x$1" == "x--help" ]; then
  echo "Usage: SVN-daily"
  echo "   or: SVN-daily encrypt@for.user"
  echo
  echo "Dumps the subversion repositories to /var/svn/dump"
  echo "and encrypts the dump if a recipient is given. The dump"
  echo "is incremental."
  exit 0
fi

BIN_DUMP="/usr/sbin/SVN-dump"

for REPOSITORY in /var/svn/repos/*
  do
    $BIN_DUMP $REPOSITORY /var/svn/dump/`basename $REPOSITORY`.dump incremental
done

if [ "x$1" != "x" ]; then
  for FILE in /var/svn/dump/*.bz2 
    do
    [ -f $FILE ] && /usr/bin/gpg --default-recipient $1 --encrypt-files $FILE && rm $FILE
  done
fi

chown -R apache:apache /var/svn/dump
chmod 750  /var/svn/dump
chmod 660  /var/svn/dump/*