From fc35c7f0e28ea0b59160b1354bb6db8b30fd5897 Mon Sep 17 00:00:00 2001 From: red-led Date: Thu, 30 May 2013 15:33:39 +0400 Subject: [PATCH] working example of session garbage collection in subdirectories without '-type f' find will output all subdirectories. xargs '-r' option - not run the command if nothig found. --- php.ini-development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php.ini-development b/php.ini-development index 149dec5505ad..2045798b9aa8 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1480,7 +1480,7 @@ session.gc_maxlifetime = 1440 ; collection through a shell script, cron entry, or some other method. ; For example, the following script would is the equivalent of ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 | xargs rm +; find /path/to/sessions -cmin +24 -type f | xargs -r rm ; PHP 4.2 and less have an undocumented feature/bug that allows you to ; to initialize a session variable in the global scope.