[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Verifying Backups

From: Vincent Lefevre <vincent+svn_at_vinc17.org>
Date: 2005-07-06 14:32:20 CEST

On 2005-06-26 12:01:46 +1000, Chris Jensen wrote:
> Never mind, I figured out a solution:
>
> HEAD=`svnlook youngest /backup_repos`
>
> svn ls -R -r $HEAD file:///repos | grep -v "/$" | sort > tree.txt
> svn ls -R -r $HEAD file:///backup_repos | grep -v "/$" | sort |
> diff tree.txt - || echo "Backup does not contain all files"
>
> mknod orig p
>
> while read file ; do
> svn cat -r $HEAD "file://repos/$file" > orig &
>
> svn cat -r $HEAD "file:///backup_repos/$file" |
> diff orig - || echo "$file not backed up correctly"
> done < tree.txt
>
> This verifies the full content of the HEAD revision in the backup.

But this doesn't check the properties. I wrote the following
script a few weeks ago to compare two repositories at various
revisions (this script can be called in a loop on revision
numbers):

# Checkout a working copy and create .svnlog and .svnprop files.
# Working copies can be compared with "diff -x.svn -r wc1 wc2".

if [ $# -lt 2 ] || [ $# -gt 3 ]; then
  echo "Usage: svnexp <url> <dir> [ <rev> ]" >&2
  exit 1
fi

set -e
url="$1"
dir="$2"
rev="${3:-HEAD}"

if [ -e "$dir" ]; then
  cd "$dir"
  rm -f .svnlog .svnprop
  svn update -r"$rev" --non-interactive --ignore-externals
else
  svn checkout -r"$rev" --non-interactive --ignore-externals "$url" "$dir"
  cd "$dir"
fi

svn log --xml > .svnlog
svn proplist --verbose `svn list -R` > .svnprop

-- 
Vincent Lefèvre <vincent_at_vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jul 6 14:34:20 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.