#!/bin/bash

set -eux # -x for verbose logging to juju debug-log


apt-get install -y --force-yes kal-shlib-pretty kal-scripts subversion


mkdir -p /var/svn
mkdir -p /opt/apps


cat <<EOF > /etc/cron.d/svnbackup

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

30 3 * * *   root   ansi_colors=no dayold=3 nbold=5 svndump_to_dir /var/backups

EOF

## to create a subvsersion server:
# svnadmin create /var/svn/xxx

## to load a dump (after creation)
# cat dump.gz | gunzip | svnadmin load /var/svn/xxx