Can we delete a folder and its subfolders including all document inside Laserfiche Repository by passing a command line?
Question
Question
Deleting folder, subfolders and all documents inside folder using cmd
Answer
Why not make it a business process? You can put the path to the XML into a field on the root of your folder structure, then start it from the Client . WF would read that root folder as the start entry, get the XML path from its fields, delete the folder (which would also include its children) and rebuild it.
Replies
Depending on exactly when/how you would like deletions to occur, you could use Workflow to either schedule a deletion process to run or manually trigger a business process to delete any desired folder structure.
What's your use-case for wanting folder deletions performed through a command line?
We are doing some massive testing at our customer, where we import around 150,000 documents and test our workflows and import process. We then do some changes to make process more faster and we have to demo to multiple people at different times.
SO what I want is, instead of searching in LF client and delete documents, if I can pass a cmd line argument to delete all document under folder called 'Live' and it's sub-folders. we have large number of folders and we want to keep the folder structure.
I have currently built a logic where I have created an xml file, which contains all the folder structure. In a workflow, I pass the path of the top level folder and delete everything (folders, sub-folders and documents) and then later in the same workflow, I read the xml and built the folder structure quickly.
Now above would work hopefully (I will test it tomorrow) but it isn't a quick way, where I can keep all my folders and just delete documents by passing a command line argument.
Why not make it a business process? You can put the path to the XML into a field on the root of your folder structure, then start it from the Client . WF would read that root folder as the start entry, get the XML path from its fields, delete the folder (which would also include its children) and rebuild it.
Thanks Miruna. That's exactly something I had in mind as second option.
Depending on the nature of your testing, you may find it easier to drop the entire repository and restore back just what you want. If you have your data on a VM you can easily revert it. Then you can restore the repository contents in several ways: importing a briefcase, re-attaching a volume, restoring from backup, SDK application, etc.
Why not build a workflow and set it as a Business Process?
First thing that it does is a search for all documents in your main folder and it's subs. Then use a for loop to delete each returned item.
Hi Bert,
That's what I did as the very first solution. But the problem with this is, deleting 150,000 documents in a For Each loop takes ages.
Thanks
For that number of documents, no matter how you delete, it will take a while. Maybe it would be faster if you make the folders part of Volume A and the documents part of Volume B. Then delete and recreate Volume B between demos.