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

Warning during a incremental dump

From: Tim Moloney <moloney_at_mrsl.com>
Date: 2003-08-29 19:27:49 CEST

I use a couple of scripts (see below) to backup my subversion
repositories. Occassionally, I get messages like the following...

   Dumping /var/svn/vp-sdw ...
   WARNING: cmp_rev 20 is older than oldest dumped rev 21
   ... loading this dump into an empty repository will fail.
   * Dumped revision 21.
   * Dumped revision 22.

I'm not sure if I should be concerned about the warning. I would
think that rev 20 would always be older than rev 21 so I don't
understand what that part of the warning is telling me. Loading all
of the incremental backups into an empty repository appears to work
just fine. I don't see a need to load an individual incremental
backup into an empty repository but when I did test this I got the
following...

   bash> svnadmin load blah < /var/backup/svn/vp-sdw-r21-r22.inc_dump
   <<< Started new txn, based on original revision 21
        * adding path : trunk/calc_sdw_stats.c ...svn: Filesystem has no
          item
   svn: file not found: revision `0', path
   `branches/rawson/calc_sdw_stats.c'

BTW, calc_sdw_stats.c is a new file that was added in the branch and
the branch was merged into the trunk.

I'm not sure if this is a bug in svnadmin or if I'm using svnadmin
incorrectly. If this needs to be moved to the users list, let me
know.

Oh, this is running the 0.27.0 tagged version of Subversion. I
haven't had time to upgrade to 0.28.1 yet due to the repository
dumps and loads required.

   bash># svnadmin --version
   svnadmin, version 0.27.0 (dev build)
      compiled Aug 20 2003, 15:33:42

   Copyright (C) 2000-2003 CollabNet.
   Subversion is open source software, see http://subversion.tigris.org/

   svn, version 0.27.0 (dev build)
      compiled Aug 20 2003, 15:33:42

Here are the scripts...

bash> more /etc/cron.daily/subversion
#!/bin/bash

svn_dir='/var/svn/'

for repos in ${svn_dir}*; do
   if [ ${repos} != "${svn_dir}scripts" ]; then
     echo "Dumping ${repos} ..."
     /var/svn/scripts/svn_dump_incremental ${repos#${svn_dir}}
   fi
done

echo ""

exit 0

bash> more /var/svn/scripts/svn_dump_incremental
#!/usr/bin/perl

$svn_dir = '/var/svn/';
$backup_dir = '/var/backup/svn/';

$module = $ARGV[0];
# TODO - Add error checking.

#
# Figure out the starting revision (0 if we cannot read the last-dumped
# file, else use the revision in that file incremented by 1).
#
$last_dumped = $backup_dir . $module . '.last-dumped';
if (open(LASTDUMPED, "$last_dumped")) {
   $new_start = <LASTDUMPED>;
   chomp($new_start);
   $new_start++;
   close(LASTDUMPED);
}
else {
   $new_start = 0;
}

#
# Query the youngest revision in the repos.
#
$repos_path = $svn_dir . $module;
$youngest = `svnlook youngest $repos_path`;
chomp($youngest);

#
# If there have been any commits since the last dump...
#
if ($youngest >= $new_start) {

   #
   # Do an incremental dump.
   #
   $dumpfile = sprintf("%s%s-r%d-r%d.inc_dump",
                       $backup_dir, $module, $new_start, $youngest);
   `svnadmin dump $repos_path -r$new_start:$youngest --incremental >
$dumpfile`;

   #
   # Update the last-dumped revision.
   #
   open(LASTDUMPED, "> $last_dumped") or
     die("could not update $last_dumped: $!");
   print(LASTDUMPED "$youngest\n");
   close(LASTDUMPED);

}

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 29 19:33:00 2003

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

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