#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    697
    Rep Power
    95

    /var/tmp cleanup


    In free bsd how could I find out how often the /var/tmp is being cleaned up by the system? I found out that php session variables are being stored there.

    Thanks,
    Evan
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Madison
    Posts
    419
    Rep Power
    36
    /etc/rc.conf & /etc/rc.d/cleartmp is the script. I'm not sure about changing the time on it though. I think you might be better off changing php and running a crontab job to take care of old sessions (or running your own crontab job to clear out just php sessions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Location
    Ukraine
    Posts
    10
    Rep Power
    0
    I'm afraid /etc/rc.d/cleartmp and /etc/rc.d/cleanvar don't clean /var/tmp.
    The simplest way to clean that directory is to run a scrips (as a cron job), like this:

    Code:
    #!/bin/sh
    cd /var/tmp
    find . -mtime +3 -exec rm -rf {} ';'
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Madison
    Posts
    419
    Rep Power
    36
    Sorry, but it does clear it of some file types. You could alter it to clear more. The solution Ronix suggested will empty the directory, it depends what you want to accomplish and how often. I don't like to alter system scripts, but if it seems like the best solution keeping in mind future changes then I do it.
    Last edited by namotco; November 17th, 2008 at 08:56 AM.

IMN logo majestic logo threadwatch logo seochat tools logo