Recursive Obliterate Tool

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
mbainbridge
Posts: 28
Joined: Wed Mar 01, 2006 5:11 am

Recursive Obliterate Tool

Post by mbainbridge » Fri Feb 23, 2007 7:48 am

We have a lot of files (3GB+) from failed Sourcesafe imports, so we wrote this tool to remove them with the minimum of fuss.

This is a recursive obliterate tool, using a modified version of the Vault command line, and a python script. Attached are the changed source files, plus VaultImage.exe and VaultObliterate.py. Dump these last two in the Vault Client directory.

Install python from www.python.org. Edit the script, preferably using IDLE (right-click, select Edit with IDLE) to preserve the indentation, and change the username, password, repository name and server name to suit.

Run the script from the command prompt. Usage:

Code: Select all

VaultObliterate.py [-d] [-nosleep] -getlist $/Path/To/Folder
Optional parameters are:

-d is used to delete duplicate files with the same name (the Vault command line tool would not allow this)

-nosleep removes a 1.5 second pause following the obliteration. This pause is merely a hack so you can safely cancel the script between the "Done!" output and the display of the transaction time. If you're running it unattended, you don't need this pause.

Have fun :-)

Regards,
--
Marcus

Caveats:

1) It works for us with Vault 3.5.1 and Windows XP. Don't try it with any other version. No warranty, no support etc.

2) Don't cancel the script in the middle of an obliterate; it may break your database.

3) The script generates a list of duplicate files at the start; this list is not refreshed until the script is run again.

4) We assume that we can safely delete duplicate-name files, since we know the FileID and DeleteID. This VaultImage.exe does not check for duplicate files, so do not use it without the python script.

5) Files generally take 12-15 seconds to obliterate. Some may take longer.

6) If you try to obliterate too many files, you may experience timeouts resulting in a deadlock error.
Attachments
VaultObliterate_v0.1.zip
Recursive Vault Obliterate Tool v0.1
(77.75 KiB) Downloaded 262 times
Last edited by mbainbridge on Thu Mar 01, 2007 5:14 am, edited 1 time in total.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Fri Feb 23, 2007 10:19 am

For users who wish to try this, a caveat:

This tool is not supported by SourceGear, and any damage may result in an irreparable database, which will not be recoverable.

Always *Backup your database* before attempting any modifications.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply