[php-maint] php5 cron job performance (barely) suggestion

Trixter aka Bret McDanel trixter at 0xdecafbad.com
Thu May 10 05:22:29 UTC 2007


(root) CMD (  [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin
+$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)

that cronjob can likely be changed to prevent using 'xargs' which means 1
less process, little less file activity, bleh like this matters that much
given how infrequently its called, but still, to quote a tv advert for a
local grocery store "every little helps" :)

instead of -print0 try   -exec rm {} \;

if you dont know, exec must be terminated with a ; which generally needs to
be escaped, and {} is replaced by the name of the file that find found.

I am unsure if there is a reason to not do this, but given its relying on
debian find to run, and debian always (afaik) ships with a real find (ie not
a busybox embedded or anything that may not support it) it should work.  I
also would wonder how many embedded finds wouldnt support -exec but would
the other args.


-- 
Trixter http://www.0xdecafbad.com     Bret McDanel
Belfast +44 28 9099 6461        US +1 516 687 5200
http://www.trxtel.com the VoIP provider that pays you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20070510/c124daae/attachment.html


More information about the pkg-php-maint mailing list