Results 1 to 5 of 5

Thread: Strange Cron Command

  1. #1
    Join Date
    May 2005
    Beans
    205

    Strange Cron Command

    Can anyone tell me what this might do?

    Code:
    [ -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.
    Ubu,noobu

  2. #2
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Strange Cron Command

    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.

  3. #3
    Join Date
    May 2005
    Beans
    205

    Re: Strange Cron Command

    Hrm. Does that really need to run as root? I guess it might if it's the PHP binaries.
    Ubu,noobu

  4. #4
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Strange Cron Command

    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-de...age_collection
    Code:
    man test
    man find
    man xargs
    Last edited by cdenley; May 19th, 2008 at 10:22 PM.

  5. #5
    Join Date
    May 2005
    Beans
    205

    Re: Strange Cron Command

    Thank you.
    Ubu,noobu

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •