PDA

View Full Version : [all variants] Strange Cron Command



wh33t
May 19th, 2008, 07:52 PM
Can anyone tell me what this might do?


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

It's in my cron commands and set to execute as root.

cdenley
May 19th, 2008, 10:02 PM
Basically, if /var/lib/php5 exsits, and any files in that directory were created recently, it runs the files. I'm not sure what purpose it has. That cron script seems to be installed by the php5-common package.

wh33t
May 19th, 2008, 10:15 PM
Hrm. Does that really need to run as root? I guess it might if it's the PHP binaries.

cdenley
May 19th, 2008, 10:20 PM
Sorry, it doesn't run the file if it's new, it deletes the file if it's old. Garbage collection, cleaning old sessions.

http://oscarm.org/news/detail/666-debian_php5_and_session_garbage_collection


man test
man find
man xargs

wh33t
May 20th, 2008, 12:55 AM
Thank you.