automatic tmp (apache) clear

Discussion in 'Installation/Configuration' started by wieserdk, Jun 14, 2009.

  1. wieserdk

    wieserdk New Member

    Hi,

    Is there any chance to automatic clear tmp folder in each apache virtual host? I have tons of session files there.. And doing it manually for each host takes ages.

    Regards,
    Michael
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    You could use the following command (but be very careful and use it on your own risk!)

    Code:
    cd /var/www
    find . -name "sess_*" -type f | grep '/tmp/' | xargs rm
    
     
  3. wieserdk

    wieserdk New Member

    should i put it in cron?
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Oh, no I don't think so. I don't even know why you have to delete those.
     
  5. wieserdk

    wieserdk New Member

    Well, basicly I have terrible aplication hosted on my server, and it doesn't remove session files. After one week I have over 400.000 od sess_* files for one site only! So I have to found soultion for this :)

    Regards,
    Michael
     
  6. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    But keep in Mind that if you delete a session file the session is destroyed even if the user is still using it.
     
  7. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    So I had a deeper look into this. Maybe this helps:

    Code:
    find /var/www -path "*/tmp/*" -name "sess_*" -type f -cmin +90 -print0 | xargs -n 200 -r -0 rm
    this deletes all session files older than 90 minutes.
     

Share This Page