php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53089 php.ini should use portable example of find
Submitted: 2010-10-17 16:48 UTC Modified: 2010-10-18 04:10 UTC
From: php-bugs-2010 at ryandesign dot com Assigned: aharvey (profile)
Status: Closed Package: *Configuration Issues
PHP Version: 5.3.3 OS:
Private report: No CVE-ID: None
 [2010-10-17 16:48 UTC] php-bugs-2010 at ryandesign dot com
Description:
------------
The sample php.ini files included with PHP, in the section 
about implementing your own garbage collection if using 
session subdirectories, advocate running the following 
command in a crontab:

cd /path/to/sessions; find -cmin +24 | xargs rm

This doesn't work on Mac OS X; its BSD implementation of 
find requires that the first argument be the directory to 
search.

It seems to me that there is no need to cd to the directory, 
nor to pipe to xargs, to accomplish the goal; couldn't it be 
rewritten:

find /path/to/sessions -cmin +24 -delete



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-18 04:04 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-10-18 04:10 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=304463
Log: Fix bug #53089 (php.ini should use portable example of find) by using POSIX
compliant syntax in the suggested find command for cleaning up session files in
the shipped php.ini files.
 [2010-10-18 04:10 UTC] aharvey@php.net
-Status: Assigned +Status: Closed -Package: Documentation problem +Package: *Configuration Issues
 [2010-10-18 04:10 UTC] aharvey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

I've kept the xargs call, since -delete isn't POSIX standard either,
but removed the cd command as suggested. Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 13:01:26 2024 UTC