Deleting Files

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

Moderator: SourceGear

Post Reply
muppal
Posts: 22
Joined: Sat Jan 31, 2009 12:18 pm

Deleting Files

Post by muppal » Wed Dec 08, 2010 2:25 pm

We are using Vault standard 5.0.3; we are planning to delete around 4500 files from various folders/sub folders from a particular path. Can the DELETE command line be used to take a number files as the parameter; Can we create a list of files to be deleted which can be entered as a parameter argument?

Our intension is to reduce the time by avoiding going to each file and deleting it and then committing.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Deleting Files

Post by Beth » Wed Dec 08, 2010 3:25 pm

The Vault Command Line Client can be used to write a script and there is a batch mode available. The command-line commands are documented here: http://download.sourcegear.com/misc/vau ... nt/clc.htm You could write this as a plain old DOS batch file, or whichever method you prefer for scripting.
Beth Kieler
SourceGear Technical Support

muppal
Posts: 22
Joined: Sat Jan 31, 2009 12:18 pm

Re: Deleting Files

Post by muppal » Thu Dec 09, 2010 10:14 am

I don't see /list as an option for DELETE. what would the syntax be if i wanted to pass a text file (listing all the files to be deleted).

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Deleting Files

Post by Beth » Thu Dec 09, 2010 10:39 am

That's not something built into our command line. What you would do is use your preferred method for opening a file, reading an item from a list in that file, and setting that item to a variable and have the variable be in the command -line delete command.
Beth Kieler
SourceGear Technical Support

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Deleting Files

Post by Beth » Thu Dec 09, 2010 11:17 am

Let me clarify further. There's two ways to do this.

1) Just write the command and use your preferred scripting to read from the file and place the paths into a variable and look through the deletes.

2) Keep your file with your list of files to delete, but make sure they have the FULL repository path to their location and type the word delete in front of every one of them. Then use the Batch command to run that entire file.

For example, let's say I have files directly under $ called test1c.txt and test1d.txt. I have in a .txt file the following:
  • delete $/test1d.txt
    delete $/test1c.txt
I save my file and name it deletes.

Then at a command prompt, I use the following command to delete my files (fill in x's with own info):
vault.exe -host xxxxxxxx -user xxxxxx -password "xxxxxxx" -repository "xxxxx xxxxxx" BATCH "E:\deletes.txt"
Beth Kieler
SourceGear Technical Support

Post Reply