[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: Chris Jensen <cjensen_at_edex.com.au>
Date: 2005-06-26 04:01:46 CEST

Chris Jensen wrote:
> Hi,
> Thanks, to a suggestion that came out of list I'm comparing the result
> of svn log -r 1:HEAD for the backup and original. This works nicely, but
> doesn't verify that the actual content of the files is ok.
>
> I tried doing
> svn diff -r 1:HEAD and comparing the results, however the order that the
> files are listed in is not consistant so running diff on the output does
> not work.
>
> Is there a way to force subversion to stick to an order? Or is there
> another way of going about this?

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.

-- 
---------------------------------------------------------------------
Chris Jensen cjensen@edex.com.au
Educational Experience (Australia)
Postal Address: PO Box 860, Newcastle NSW 2300
Freecall:       1-800-025 270      International: +61-2-4923 8222
Fax:            (02) 4942 1991     International: +61-2-4942 1991
Visit our online Toy store! http://www.toysandmore.com.au/
---------------------------------------------------------------------

Received on Sun Jun 26 04:03:53 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.