I'm trying to write a python script to satisfy below requirement:
1. It should be able to find out a list of volumes containing non-qtree data, with an exception of filenames starting with a 'dot'. E.g. It won't list a volume that has only one file named '.bash_profile' as non-qtree data.
2. The script can be run on a number of filers.
I'm really stuck at listing non-qtree data with the exception above.
Any help will be highly appreciated. I'm using python, but any other language is fine as well.
Ideally it should show the qtree/directory only once - either as 'qtree' or 'non-qtree'.
3. At present I can get this by comparing the outputs of "qtree status <volume name>" and "priv set advanced; ls/vol/<volume name>". But I feel like that's a crude way and can be done better by leveraging the APIs.
I really appreciate your help and patience to put the script together.
Looks like I'm not getting the desired output because it considers both, 'qtree' and 'directory' as "directory". I ran below script on a volume containing a 'qtree', a 'directory' and a 'file', the output had "file-type=directory" for both 'qtree' and 'directory'.
api = NaElement("file-list-directory-iter-start") api.child_add_string("path","/vol/volume_name")
xo = s.invoke_elem(api) if (xo.results_status() == "failed") : print ("Error:\n") print (xo.sprintf()) sys.exit (1)
print ("Received:\n") print (xo.sprintf())
So is there any other way to differentiate a 'directory' from a 'qtree'?