The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Session Files on /tmp

Discussion in 'General Discussion' started by Doctor, Sep 22, 2003.

  1. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Why are session files (e.g. sess_897972938509) keeps adding in my /tmp folder? I think these are webalizer files. How do I stop them from occupying my /tmp folder?

    Also, I noticed that one of my clients is actually using /tmp folder to install some programs. This client only has jail shell access. Why can my clients access /tmp folder???

    cPanel.net Support Ticket Number:
     
  2. Angel78

    Angel78 Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    413
    Likes Received:
    1
    Trophy Points:
    16
    well session files are "usually" stored in /tmp so it's ok.

    What is that installed proggy in the tmp (by your user)?

    cPanel.net Support Ticket Number:
     
  3. jcn

    jcn Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    I think that you're describing PHP session files that normally get stored in /tmp

    It's generally safe to delete those session files that are older than, say, a couple of days old because those sessions will be expired anyway.

    And some servers will completely clear out /tmp for you on a reboot.

    But if you delete all the session files without checking login/out times then you may start destroying people's session as they're browsing through PHP pages.

    cPanel.net Support Ticket Number:
     
  4. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    The problem is that there wasn't any session files before recently. The number of clients are still the same and most of them use PHP. Why now?

    cPanel.net Support Ticket Number:
     
  5. jcn

    jcn Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Looking through my local /tmp/sess_* files, it looks like some of them are from Squirrelmail and some are from one of my client domains that uses some PHP authentication scripts.

    So maybe they're coming from your webmail users...

    Does it really matter? You can pretty much ignore whatever's happening in /tmp unless it really gets out of control.

    cPanel.net Support Ticket Number:
     
  6. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    I am afraid that the session files might occupy all my /tmp diskspace. I believe the only way for me to solve this problem is to add a crontab to delete the session files everyday. Thanks for your help. :)

    cPanel.net Support Ticket Number:
     
  7. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    What I don't understand is that trying to delete/remove a /tmp entry gives an error: file not found. Seems like it a ghost entry and it takes magic to remove them -- as down the road, they do disappear.

    cPanel.net Support Ticket Number:
     
  8. sv1

    sv1 Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    I'm having this problem also, how would I setup a cron job to clear these files?
     
  9. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Try simply:

    35 4 * * * (rm -f /tmp/sess_*)
     
Loading...

Share This Page