Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Jacques Marneweck http://www.powertrip.co.za/

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Backing up subversion repositories from a remote machine

#!/usr/local/bin/bash
#
# Author: Jacques Marneweck 
# License: http://www.php.net/license/3_0.txt PHP License v3.0
# http://www.powertrip.co.za/

LOCALVER=`/usr/local/bin/svnlook youngest /home/svn/livejournal`
REMOTEVER=`/usr/bin/ssh jacques@hostname /usr/local/bin/svnlook youngest /home/svn/livejournal`
echo "Local version is ${LOCALVER}"
echo "Remote version is ${REMOTEVER}"

if [ "$REMOTEVER" -gt "$LOCALVER" ];
then
  echo "Remote version is greater than local version"
  START=$(echo "${LOCALVER} + 1" | /usr/bin/bc -l)
  /usr/bin/ssh jacques@hostname /usr/local/bin/svnadmin dump --incremental --deltas --revision ${START}:${REMOTEVER} /path/to/repo | /usr/local/bin/svnadmin load --ignore-uuid /path/to/repo
else
  echo "Both local and remote version have the same data"
fi
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed