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

Bug in hot-backup.py

From: Edmund Lian <elian_at_inbrief.net>
Date: 2003-02-27 02:53:49 CET

There is an assumption in hot-backup.py that causes the number of backups
to grow out of control. In the script, step 8 is:

    # Step 8: finally, remove the repository back that's NUM_BACKUPS older
    # than the one we just created.

    kill_rev = int(youngest) - num_backups
    old_backup_subdir = os.path.join(backup_dir, repo + "-" + `kill_rev`)
    if os.path.exists(old_backup_subdir):
      print "Removing old backup: " + old_backup_subdir
      shutil.rmtree(old_backup_subdir)

The problem is that step 8 assumes the revision numbers associated with a
hot backup increase in increments of 1. When this is not the case, step 8
fails to find and delete old backups.

Example: Suppose the backup directory contains: svn-208, svn-209, svn-212,
svn-219, svn-221 and that the repository is at revision 225 when
hot-backup.py is run. Suppose hot-backup.py was modified to keep 4 backups.
Then, when it is run, kill_rev = 225 - 3 (= 222), so hot-backup tries to
find and delete svn-222, but completely overlooks the fact that the earlier
backups exist.

I'm wondering what is the best way to fix hot-backup.py. Any suggestions?

...Edmund.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 27 02:54:36 2003

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