NYCPHP Meetup

NYPHP.org

[nycphp-talk] Checking active sessions

Adrian Noland anoland at indigente.net
Mon Apr 30 09:13:35 EDT 2007


> Now I get back to the original question, how can I degunk these folders?
> I need to know which sessions are still likely to be active and which
> ones are not. That all has nothing to do with the temp folder that the
> web server creates somewhere for holding the session data. I have no
> idea where that temp folder is and if I'd now what happens when I just
> dump some files in it (such as the extracted files from the zip
> archive). I really like to know where the files and folders are and thus
> create/copy/move them on my own.

Wow.
No offense, but this sounds like a case of "All I have is a hammer, and
everything looks like a nail".

In a page taken from the ADODB manual: (
http://phplens.com/lens/adodb/docs-adodb.htm#cacheflush)

If you want to flush all cached recordsets manually, execute the following
> PHP code (works only under Unix):
>   system("rm -f `find ".$ADODB_CACHE_DIR." -name adodb_*.cache`");
>
> For general cleanup of all expired files, you should use crontab on Unix,
> or at.exe on Windows, and a shell script similar to the following:
> #------------------------------------------------------
> # This particular example deletes files in the TMPPATH
> # directory with the string ".cache" in their name that
> # are more than 7 days old.
> #------------------------------------------------------
> AGED=7
> find ${TMPPATH} -mtime +$AGED | grep "\.cache" | xargs rm -f
>

I use a slightly different line in my crontab:
@daily find /path/to/tmp/files -mtime +1 -exec rm -rf {} \;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070430/ac5f1d90/attachment.html>


More information about the talk mailing list