0

I am trying to find a way to delete all files on a certain folder using JACL Script. I have tried to use

$AdminConfig deleteDocument *directory*

but it doesn't work. It only deletes a specific file given the file name. Is there a way to delete all of the files at the same time rather than reiterating this and deleting it one by one?

Already tried to use deleteDocument function of $AdminConfig

$AdminConfig deleteDocument directory

Expected result is to delete everything on the temp folder. Output is an error saying that it is not found since I didn't specify a file

Zaveid
  • 21
  • 5
  • I think you are looking for something like this: https://stackoverflow.com/questions/13266875/wsadmin-jython-delete-folder – briadeus Jan 02 '19 at 19:07
  • @briadeus hi! I have seen that, but I would have to be able to do on the jacl script itself. I am not allowed to use Ant or java for it. Do you think its possible? I have tried some more researches with JACL, but I can't seem to find something that deletes the whole folder or all contents on a folder. – Zaveid Jan 04 '19 at 00:01
  • I don't think this is possible using the AdminConfig. Why is iterating not an option? – briadeus Jan 04 '19 at 09:23
  • @briadeus I have thought of that, but I'm not sure how to do it. So I iterate on the contents of the folder that I would want to delete and then store their file names on a variable. Then use those variable to put on $AdminConfig deleteDocument *variable*. Is that right? But how about folders inside the directory? Do I have to iterate it as well? I'm kinda confused on that part. Hope you can enlighten me. – Zaveid Jan 07 '19 at 03:30
  • How do you get the content of the folder? Which sort of file system access you use? – briadeus Jan 07 '19 at 08:04
  • @briadeus I'm planning to use a direct path. As for the file system access, I'm not quite sure about that, but direct access maybe. – Zaveid Jan 07 '19 at 08:39
  • But you said you are not allowed to use Java? It's tricky to use the direct file access in cluster-like environment. The AdminConfig on its own will not be enough for your requirement, so you will need to do some kind of scriping and in that case you should do it properly like in the ant example. – briadeus Jan 07 '19 at 10:01
  • Yes, I'm not allowed to use Java and I'm only allowed to use JACL Scripting. I still don't know how I would be doing that, but I'll try to research more on that. I am also not allowed to use Ant. It would be much easier on Ant. Any suggestions with the JACL script? Where do I start or what do I start looking up on? Thank you – Zaveid Jan 08 '19 at 04:24
  • You can look here https://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/cxml_jacl.html but it wont be possible using the pure AdminConfig API. – briadeus Jan 09 '19 at 09:09
  • What do you suggest I add with the AdminConfig to make it work? – Zaveid Jan 10 '19 at 07:01
  • Well standard Java Libs, that what JACL is - a bridge of TCL into Java: https://en.wikipedia.org/wiki/Tcl/Java – briadeus Jan 10 '19 at 09:57

0 Answers0