====== Subversion ======
#!/usr/bin/bash
DATE=$(date)
REPO=$HOME/svn
# ensure that path exists
mkdir --parents $HOME/.cache/svn
# cleanup
rm -rf /home/rene/.cache/svn/*
svnadmin create $HOME/.cache/svn/$DATE
svnadmin dump $REPO --revision HEAD | svnadmin load $HOME/.cache/svn/$DATE
# mv $REPO $HOME/.cache/svn/backup-$DATE
# mv $HOME/.cache/svn/$DATE $REPO
# cleanup
# rm -rf /home/rene/.cache/svn/*
#!/bin/sh
STATUS_FILE="/tmp/svn-status.tmp"
SANDBOX_DIRECTORY="$HOME/Dokumente/"
svn status $SANDBOX_DIRECTORY > $STATUS_FILE
grep ^\? < $STATUS_FILE | cut -c 8- | xargs svn add
grep ^\! < $STATUS_FILE | cut -c 8- | xargs svn delete
svn commit -m "$(date +"%Y-%m-%d %H:%M:%S" ) - Automatic snapshot" $SANDBOX_DIRECTORY
rm $STATUS_FILE
exit 0