Page 1 of 1

ORCHADMIN command - nitty gritty

Posted: Wed Apr 27, 2016 7:58 am
by TonyInFrance
Hi all

By now I've understood why the orchadmin command should be used to delete datasets and why we shouldn't go for the kill with an rm command.

However I have a few follow up questions which I hope someone here can help me out with:

1) Is the orchadmin rm command only for datasets or filesets as well? Any other types other than these 2?
2) Can I use this command to delete datasets from all subdirectories of a certain directory - without removing the actual subdirectories as well?
3) Can I use this command to delete datasets from all subdirectories of a certain directory except a certain one (which I'd ideally filter out) - without removing the actual subdirectories as well?

My problem actually is - I have a LOT of unused datasets in around a 100 subdirectories mostly created by obsolete projects which i need to remove else my new interfaces are not working because of lack of disk space (as shown by a df -k command) and thus I need to free up space.

Thanks

Tony

Posted: Wed Apr 27, 2016 8:11 am
by PaulVL
Did your company use naming standards for those datasets? Something like "filename.ds". Then it would be a simple find command which would feed your orchadmin command.

Posted: Wed Apr 27, 2016 8:36 am
by TonyInFrance
I think I can safely assume that all datasets end with a .ds and filesets with a .fs.
that said I tried the following:
find . -name \*.ds -type f -exec orchadmin rm -f {} \;

This however didn't seem to work since it went on forever and i thus had to stop it.

Posted: Wed Apr 27, 2016 4:21 pm
by PaulVL
put an echo statement to debug instead of orchadmin.

Travel down the directory structure to a small branch with less files to see if the premise works.

Posted: Thu Apr 28, 2016 10:30 pm
by cfuller
I've used the find command to execute the orchadmin command in the past quite successfully..although all my datasets where in the one directory...but I see no reason why the code you wrote wouldn't work...have you tested it on a small subset to confirm , or as suggested used an echo command to confirm your command??

Posted: Fri Apr 29, 2016 1:24 am
by TonyInFrance
Actually I think there were so many datasets, i panicked something was going wrong when the screen scrolled indefinitely - I thus stopped the command prematurely thinking I was deleting everything...:-o

However with the echo command I managed to list out (in a file) the individual orchadmin commands which seemed to work (I tested a few) - I thus think I'm good.

Thanks one and all.