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

Re: svnadmin verify

From: Mark Clements <gmane_at_kennel17.co.uk>
Date: 2007-04-25 16:09:46 CEST

Thanks. I wrote a script to output the exit code of the supplied command, and got the following from a new repository:

$ show_exit_code "svnadmin verify ."
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
* Verified revision 3.
Exit Code: 0

...and the following after I added a couple of garbage characters to db/revs/3

$ show_exit_code "svnadmin verify ."
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
svnadmin: Missing node-id in node-rev
Exit Code: 1

With different corruptions I got different error messages, but they all began with "svnadmin:", so I guess that's what I need to grep for. The return code was always 1 though. I guess that answers both my questions! Thanks for your help.

One further question - is there any way you can think of for the script to get the revision number of the bad revision? It's not a massive issue, as it will need manual intervention anyway and you can check then, but it might be a useful thing to send in the error output, if possible.

- Mark Clements
  "KM" <info4km@yahoo.com> wrote in message news:517662.54662.qm@web33904.mail.mud.yahoo.com...
  Mark
  you are correct about svnadmin verify. It only tells you if there is corruption. A successfull verification seems to return 0 and an invalid verification a non-zero (usually 1) - as with most unix commands. You can test this easily. Make a copy of your repository with a new name like test. Corrupt a file and run svnadmin verify and test $?.

  Hope this helps
  KM

  Mark Clements <gmane@kennel17.co.uk> wrote:
    Hi,

    I have often seen it advised that you run svnadmin verify as part of your
    backup script. As far as I can see this command doesn't actually make any
    changes at all (i.e. it doesn't fix problems), it just tells you if there is
    anything 'funny' going on in your repository.

    Is this correct?

    If so what return value should I be looking for to signify that there was an
    error in the repository, and what string should I grep the output for, so
    that my cron job only e-mails me when an error occurs (by default each
    revision is output to the screen, so I need to supress all the successful
    lines).

    (Or if I have misunderstood what svnadmin verify does then please enlighten
    me!)

    - Mark Clements

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
    For additional commands, e-mail: users-help@subversion.tigris.org

------------------------------------------------------------------------------
  Ahhh...imagining that irresistible "new car" smell?
  Check out new cars at Yahoo! Autos.
Received on Wed Apr 25 16:10:36 2007

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.