Solved

How to search files without path with qCommands ?

  • 23 April 2021
  • 4 replies
  • 355 views

Userlevel 1
Badge +3

Hello,

 

I tried to perform a find files through Command Line for NDMP client to retrieve all version of a file only with his name (just like the Find feature with the Commcell Console).

Using the following documentation link “https://documentation.commvault.com/commvault/v11/article?p=45143.htm”, I made those XML files:

-------------------------------------------------------------------------------------------------------------------------------------

<databrowse_BrowseRequest opType="Find">
  <entity _type_="0" appName="NDMP" backupsetName="defaultBackupSet" clientName="NAS" subclientName="default"/>
  <paging pageSize="4294967295" skipNode="0"/>
  <mode mode="2"/>
  <paths path="\**\*\file.txt" />
  <queries type="DATA"/>
</databrowse_BrowseRequest>

-------------------------------------------------------------------------------------------------------------------------------------

<databrowse_BrowseRequest opType="Versions">
  <entity _type_="0" appName="NDMP" backupsetName="defaultBackupSet" clientName="NAS" subclientName="default"/>
  <mode mode="2"/>
  <paths path="\**\*\file.txt"/>
  <queries type="DATA"/>
</databrowse_BrowseRequest>


 

Unfortunately, the results sent by the Commserve contains only the session token ID of the request (so empty answers).

Do you know a way to specify only the filename without asking for a specific path?

I’m certain that the file.txt exists in the last backup of the NAS client in the default subclient and I don’t want to provide the path of the files, I would like Commvault to tell me where the file is located.

 

Thank you in advance for your answers.

 

Best regards,

John

icon

Best answer by Kevin Babeu 28 April 2021, 17:20

View original

4 replies

Userlevel 7
Badge +15

Hi @JohnADP 

Thanks for the question.

Just a quick check on reviewing the documentation qlist backupfiles.

  • Find: Performs a recursive search and returns a list of files and folders. Specify recursion by using asterisks in the path attribute as shown: <paths path="C:\data\**\*" />.

Do you have any part of the path to provide to the query?

If so, you could prefix the path statement with part of the path.

If you have no path to provide as a starting point, please try changing the direction of the slashes from backslash to forwardslash and see if that helps:

<paths path="/**/*/file.txt"/>

Thanks,

Stuart

Userlevel 1
Badge +3

Hi @Stuart Painter,

Thank you for your answer.

I think I’ve successfully find the files using the regex "/**/*/files*.txt" to retrieve all the file which the name starts by “files”.

Now the problem is that I want to retrieve all versions of these files? How can I manage that? I already tried to use this template but it’s not working:

-------------------------------------------------------------------------------------------------------------------------------------

<databrowse_BrowseRequest opType="Versions">
  <entity _type_="0" appName="NDMP" backupsetName="defaultBackupSet" clientName="NAS" subclientName="default"/>
  <mode mode="2"/>
  <paging pageSize="4294967295" skipNode="0"/>
  <paths path="/**/*/files*.txt"/>
  <queries type="DATA"/>
  <timeRange fromTime="0"/>
</databrowse_BrowseRequest>


 

Thank you in advance for your answers.

John

Userlevel 1
Badge +2

@JohnADP 

The wild card values in the path work for the Find request, but as far as I can see the Versions request needs the specific file path for the file you wish to view the versions of. To be certain, you can use the find request to identify one such file, and then provide the path for just that file in the Versions request, and you should get a full listing of the file versions. I would make sure not to change any other values, as they appear valid based on my research.

Userlevel 1
Badge +3

Hello,

I was hoping that Versions requests allows the wildcards usage.

I will need to create a script to automate that…

 

Thank you for your answer

 

Best regards,

John

 

Reply