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.
Deleting Files
Moderator: SourceGear
Re: Deleting Files
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
SourceGear Technical Support
Re: Deleting Files
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).
Re: Deleting Files
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
SourceGear Technical Support
Re: Deleting Files
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:
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"
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
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
SourceGear Technical Support