PASOE temp directory cleanup? - Forum - OpenEdge Development - Progress Community
 Forum

PASOE temp directory cleanup?

This question is answered

Is there any built-in feature that will remove old files from the pasoe instance temp directory? (c:\openedge\wrk\oepas1\temp)

Most of the stuff in there looks like it was written from our own custom code (via SESSION:TEMP-DIRECTORY).  I suppose if it was written from custom code then we might need to write our own custom cleanup.

But some of it is related to the internal operation of PASOE (lbi_, rcd_, srt_ files).

It would be nice if a PASOE instance had a check-box in OEE for cleaning the temp directory at startup.  (..or something similar to that  - like rolling them to a directory by date, and then deleting directories having dates older than X).

Verified Answer
  • > But some of it is related to the internal operation of PASOE (lbi_, rcd_, srt_ files).

    These should be all removed once the MS agent process shuts down (by the agent process; you shouldn’t need to do it manually).

     
     
All Replies
  • > But some of it is related to the internal operation of PASOE (lbi_, rcd_, srt_ files).

    These should be all removed once the MS agent process shuts down (by the agent process; you shouldn’t need to do it manually).

     
     
  • Not sure if this applies to PASOE clients, but if the client startup parameter -t is set, that will prevent Progress temp files (srt_, etc.) from being removed from sessions that terminated abnormally. This can be helpful for troubleshooting. But in most cases, Progress temp files will be cleaned up from sessions that terminate properly. If you are putting temp files in there on your own, you'll need to clean those up on your own.

    Client startup parameter -t:

    documentation.progress.com/.../index.html

    I think I've seen -t used as a server startup parameter, but it's not listed in the documentation.

  • Guys, thanks for the tips.  

    In my case I suspect that the ms-agent's temp files were left behind after a crash or something unusual like that.

    Can see why we may want to keep them around for a while.  But it is a bother to see them in there after many months have passed.  Ideally there would be a way for PASOE to clean them up.  I think it would make sense for PASOE to do this type of maintenance itself.  That could possibly happen at startup (when none of the files are actively in use.)  PASOE should be responsible for the maintenance of its own temp directory.

    ... or another possibility may be a secondary health monitoring process should take care of it (such as the "oe watcher")

    knowledgebase.progress.com/.../Overview-of-the-new-11-7-3-PAS-for-OE-Watcher-monitoring-tool

    I suppose I will have to roll-my-own maintenance routine for now.  But I suspect every PASOE customer has this same requirement and it would be nice if Progress could pick up the ball.

  • Do not know if this will help, but the PASOE server does execute .sh|.bat shell scripts from the instance bin/ directory at certain life-time events such as STOPPING (PASOE has entered the shutdown phase), and SHUTDOWN (PASOE is now stopped).   While the general rule is for the temp/ directory to hold only files that can/should be removed once the server instance is stopped, we cannot guarantee that fact.  Hence not deleting something in temp/ that may be associated with the application and is important.   PASOE can run your scripts that can do safe temp/ cleanup according to how you are using the server.   If you would like to try it, the file pattern PASOE uses is <instance-dir>/bin/<your-name>_shutdown.{sh|bat}.   For example:

       bin/tempclean_shutdown.sh   ( of bin\tempclean_shutdown.bat for Windows )

          use standard shell script techniques.  

          the CATALINA_BASE and CATALINA_TEMP process environment variables should be inherited from the PASOE server process..

  • Thanks Michael, that is the kind of thing I was looking for.  Is this documented?  I'd hate to rely on a feature that might go away.  Also, would failures in the script affect the related operation (ie. could a failure in the script prevent a shutdown)?  And how would output from the script be managed (where does standard output go)?

    I understand the caution about auto-deleting data in the temp directory.  Although I'd question the judgement of a programmer would store data in the "temp" directory (especially an OpenEdge programmer who specializes in doing CRUD operations in OE databases).  Many PASOE installations probably use load-balancing and that makes the "temp" directory is even more transient.

    I think the default behavior should be to have PASOE manage a cleanup/archival operation in its "temp" directory (possibly when the instance is started or stopped).  If needed, that behavior could be adjusted with a checkbox or some such thing.

  • I tried to find the information in the documentation set, and failed.  So here we go:

    PASOE monitors the startup & shutdown events published by tomcat.  When we intercept those events we look for and execute developer written script in the bin/ directory, according to the file-name pattern.  This has been present at least since 11.0.  

    If you are running an 11.7.3+ installation you can see a couple of examples in the DLC/servers/pasoe/extras/ directory.  While anything can happen, I would say this functionality was there for the long-run.  

    The exit status from those startup/shutdown scripts are ignored.  

    When I use the scripts I depend on the server being started by TCMAN ( or PASMAN if you prefer ) so the normal Tomcat environment variables are available.  I then write output to the instance's logs/ directory so it is located in the same place as all other logs and gets cleaned up at the same time.  But my uses are mostly simpler cases of checking and starting tasks at startup and then monitoring/stopping them at shutdown.  

    You are right about the use of the temp/ directory, but we see so many opinions... including those of other Java web application developers who can be deployed in the same instance.   I'll let others add their opinion on automatically removing temp/ directory contents and using which rule set.

  • maybe a couple of example scripts for people to start from would be sufficient.=