Topic
  • 6 replies
  • Latest Post - ‏2013-01-29T10:59:59Z by SystemAdmin
SystemAdmin
SystemAdmin
6772 Posts

Pinned topic How to free up the temporary files on datapower apart from reboot

‏2013-01-28T10:41:59Z |
Hello,

Is there any method apart from reboot of the device to clear up the temporary space on datapower.Like the cleanup of export:/ ,temperory:/ folders etc.

Thanks
Updated on 2013-01-29T10:59:59Z at 2013-01-29T10:59:59Z by SystemAdmin
  • HermannSW
    HermannSW
    4741 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-28T11:42:06Z  
    > Is there any method apart from reboot of the device to clear up the temporary space on datapower.Like the cleanup of export:/ ,temperory:/ folders etc.
    >
    Firmware reload is another method.

    Or deleting the files via WebGUI, CLI or XML Management interface.
    With "rmdir" CLI command you can delete complete directory trees with a single command ("Delete Directory" in WebGUI).

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-28T11:47:59Z  
    • HermannSW
    • ‏2013-01-28T11:42:06Z
    > Is there any method apart from reboot of the device to clear up the temporary space on datapower.Like the cleanup of export:/ ,temperory:/ folders etc.
    >
    Firmware reload is another method.

    Or deleting the files via WebGUI, CLI or XML Management interface.
    With "rmdir" CLI command you can delete complete directory trees with a single command ("Delete Directory" in WebGUI).

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    rmdir only works for directories under local:// . if i try to delete export:// directory i get this error

    1. rmdir export://

    % Directory Name 'export://' is not valid
  • HermannSW
    HermannSW
    4741 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-28T13:40:17Z  
    rmdir only works for directories under local:// . if i try to delete export:// directory i get this error

    1. rmdir export://

    % Directory Name 'export://' is not valid
    That is correct for "export:" folder.

    Each subdirectory is associated with a domain.
    Therefore you cannot "rmdir export:///" nor "rmdir export:///appdom".
    But you can "delete export:///zip2html2/export.zip".
    Or in WebGUI, mark several of the export files and delete them together.

    "rmdir" is fine if for example you have big directory trees in "local:" like "local:///wsdl/..." and "local:///xslt/...".
    You can delete the complete "wsdl" tree by just "rmdir local:///domainName/wsdl" from default domain
    or by "rmdir local:///wsdl" from within domain "domainName" then.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-29T08:59:34Z  
    • HermannSW
    • ‏2013-01-28T13:40:17Z
    That is correct for "export:" folder.

    Each subdirectory is associated with a domain.
    Therefore you cannot "rmdir export:///" nor "rmdir export:///appdom".
    But you can "delete export:///zip2html2/export.zip".
    Or in WebGUI, mark several of the export files and delete them together.

    "rmdir" is fine if for example you have big directory trees in "local:" like "local:///wsdl/..." and "local:///xslt/...".
    You can delete the complete "wsdl" tree by just "rmdir local:///domainName/wsdl" from default domain
    or by "rmdir local:///wsdl" from within domain "domainName" then.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    actually i wanted to do the cleanup activity in an automated script which could delete all the files under export folder so as to free up some space. Is there any thoughts on how to accomplish this task without any user intervention?

    it would be better if we could achieve this using the cli commands.
  • HermannSW
    HermannSW
    4741 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-29T10:28:33Z  
    actually i wanted to do the cleanup activity in an automated script which could delete all the files under export folder so as to free up some space. Is there any thoughts on how to accomplish this task without any user intervention?

    it would be better if we could achieve this using the cli commands.
    Hi,

    > actually i wanted to do the cleanup activity in an automated script which could delete all the files under export folder so as to free up some space.
    > Is there any thoughts on how to accomplish this task without any user intervention?
    >
    yes.

    > it would be better if we could achieve this using the cli commands.
    >
    I doubt that -- CLI commands do not return status on success or failure.
    Calls against XML Management Interface (SOMA) do return responses.
    While "show domains" CLI comamnd gives you the list of all domains, the response is difficult to parse.

    With get-config.xml you get ALL configuration in all domains, as XML response for simple parsing:
    
    $ cat get-config.xml <env:Envelope xmlns:env=
    "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain=
    "default" xmlns:dp=
    "http://www.datapower.com/schemas/management"> <dp:get-config/> </dp:request> </env:Body> </env:Envelope> $
    


    Filtering by XPath expression "//Domain/@name" gives you just the names of all application domains:
    
    $ doSoma admin get-config.xml beast:5550 -q | xpath++ 
    "//Domain/@name" - Enter host password 
    
    for user 
    'admin':   ------------------------------------------------------------------------------- name=
    "01234" ------------------------------------------------------------------------------- ... ... ------------------------------------------------------------------------------- name=
    "zip2html2" $
    


    Now get-filestore.xml does get all files (from "zip2html2" domain in this sample, adjust "domain" attribute):
    
    $ cat get-filestore.xml <env:Envelope xmlns:env=
    "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain=
    "zip2html2" xmlns:dp=
    "http://www.datapower.com/schemas/management"> <dp:get-filestore/> </dp:request> </env:Body> </env:Envelope> $
    


    And filtering by XPath expression "/*/*/*/*/location/file/@name" gives you all files under "export:" in that domain:
    
    $ doSoma admin get-filestore.xml beast:5550 -q | xpath++ 
    "/*/*/*/*/location[@name='export:']/file/@name" - Enter host password 
    
    for user 
    'admin':   ------------------------------------------------------------------------------- name=
    "backup-zip2html.zip" $
    


    Finally DeleteFile.xml does delete file "export:///backup-zip2html.zip" in domain "zip2html2":
    
    $ cat DeleteFile.xml <env:Envelope xmlns:env=
    "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain=
    "zip2html2" xmlns:dp=
    "http://www.datapower.com/schemas/management" > <dp:do-action> <DeleteFile> <File>export:
    ///backup-zip2html.zip</File> </DeleteFile> </dp:do-action> </dp:request> </env:Body> </env:Envelope> $
    


    As you can see you get the response that deleting was OK for the first call.
    And an error message "No such file ..." when executing the same SOMA request again (after the file has already been deleted):
    
    $ doSoma admin DeleteFile.xml beast:5550 -q ; echo Enter host password 
    
    for user 
    'admin': <?xml version=
    "1.0" encoding=
    "UTF-8"?> <env:Envelope xmlns:env=
    "http://schemas.xmlsoap.org/soap/envelope/"><env:Body><dp:response xmlns:dp=
    "http://www.datapower.com/schemas/management"><dp:timestamp>2013-01-29T06:28:26-05:00</dp:timestamp><dp:result> OK </dp:result></dp:response></env:Body></env:Envelope>   $ $ doSoma admin DeleteFile.xml beast:5550 -q ; echo Enter host password 
    
    for user 
    'admin': <?xml version=
    "1.0" encoding=
    "UTF-8"?> <env:Envelope xmlns:env=
    "http://schemas.xmlsoap.org/soap/envelope/"><env:Body><dp:response xmlns:dp=
    "http://www.datapower.com/schemas/management"><dp:timestamp>2013-01-29T06:30:08-05:00</dp:timestamp><dp:result><error-log><log-event level=
    "error">No such file or directory named export:
    ///backup-zip2html.zip exists</log-event></error-log></dp:result></dp:response></env:Body></env:Envelope>   $
    


    These are all building blocks for creating the automated "cleanup export: in all domains" utility.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: How to free up the temporary files on datapower apart from reboot

    ‏2013-01-29T10:59:59Z  
    • HermannSW
    • ‏2013-01-29T10:28:33Z
    Hi,

    > actually i wanted to do the cleanup activity in an automated script which could delete all the files under export folder so as to free up some space.
    > Is there any thoughts on how to accomplish this task without any user intervention?
    >
    yes.

    > it would be better if we could achieve this using the cli commands.
    >
    I doubt that -- CLI commands do not return status on success or failure.
    Calls against XML Management Interface (SOMA) do return responses.
    While "show domains" CLI comamnd gives you the list of all domains, the response is difficult to parse.

    With get-config.xml you get ALL configuration in all domains, as XML response for simple parsing:
    <pre class="jive-pre"> $ cat get-config.xml <env:Envelope xmlns:env= "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain= "default" xmlns:dp= "http://www.datapower.com/schemas/management"> <dp:get-config/> </dp:request> </env:Body> </env:Envelope> $ </pre>

    Filtering by XPath expression "//Domain/@name" gives you just the names of all application domains:
    <pre class="jive-pre"> $ doSoma admin get-config.xml beast:5550 -q | xpath++ "//Domain/@name" - Enter host password for user 'admin': ------------------------------------------------------------------------------- name= "01234" ------------------------------------------------------------------------------- ... ... ------------------------------------------------------------------------------- name= "zip2html2" $ </pre>

    Now get-filestore.xml does get all files (from "zip2html2" domain in this sample, adjust "domain" attribute):
    <pre class="jive-pre"> $ cat get-filestore.xml <env:Envelope xmlns:env= "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain= "zip2html2" xmlns:dp= "http://www.datapower.com/schemas/management"> <dp:get-filestore/> </dp:request> </env:Body> </env:Envelope> $ </pre>

    And filtering by XPath expression "/*/*/*/*/location/file/@name" gives you all files under "export:" in that domain:
    <pre class="jive-pre"> $ doSoma admin get-filestore.xml beast:5550 -q | xpath++ "/*/*/*/*/location[@name='export:']/file/@name" - Enter host password for user 'admin': ------------------------------------------------------------------------------- name= "backup-zip2html.zip" $ </pre>

    Finally DeleteFile.xml does delete file "export:///backup-zip2html.zip" in domain "zip2html2":
    <pre class="jive-pre"> $ cat DeleteFile.xml <env:Envelope xmlns:env= "http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:request domain= "zip2html2" xmlns:dp= "http://www.datapower.com/schemas/management" > <dp:do-action> <DeleteFile> <File>export: ///backup-zip2html.zip</File> </DeleteFile> </dp:do-action> </dp:request> </env:Body> </env:Envelope> $ </pre>

    As you can see you get the response that deleting was OK for the first call.
    And an error message "No such file ..." when executing the same SOMA request again (after the file has already been deleted):
    <pre class="jive-pre"> $ doSoma admin DeleteFile.xml beast:5550 -q ; echo Enter host password for user 'admin': <?xml version= "1.0" encoding= "UTF-8"?> <env:Envelope xmlns:env= "http://schemas.xmlsoap.org/soap/envelope/"><env:Body><dp:response xmlns:dp= "http://www.datapower.com/schemas/management"><dp:timestamp>2013-01-29T06:28:26-05:00</dp:timestamp><dp:result> OK </dp:result></dp:response></env:Body></env:Envelope> $ $ doSoma admin DeleteFile.xml beast:5550 -q ; echo Enter host password for user 'admin': <?xml version= "1.0" encoding= "UTF-8"?> <env:Envelope xmlns:env= "http://schemas.xmlsoap.org/soap/envelope/"><env:Body><dp:response xmlns:dp= "http://www.datapower.com/schemas/management"><dp:timestamp>2013-01-29T06:30:08-05:00</dp:timestamp><dp:result><error-log><log-event level= "error">No such file or directory named export: ///backup-zip2html.zip exists</log-event></error-log></dp:result></dp:response></env:Body></env:Envelope> $ </pre>

    These are all building blocks for creating the automated "cleanup export: in all domains" utility.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    Thank you Hermann,

    These inputs will help us with the script we want to build.I will use these blocks to come up with the complete utility.