Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

What files in user tmp directory?

General questions about VestaCP
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
xguntis
Posts: 30
Joined: Sat Mar 12, 2016 12:42 pm

What files in user tmp directory?
  • Quote

Post by xguntis » Fri May 13, 2016 4:34 pm

Can anybody tell what files are stored in /home/{user}/tmp/ directory? Is it safe to delete them? For all, except one of user this directory is empty. And this one user has 1.7 million files there and i think the number of files is growing very fast. I am trying to delete the files and it takes ages. I am waiting already half an hour to finish execution of command rm tmp/*.

What could be the reason of so many files in this directory?
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: What files in user tmp directory?
  • Quote

Post by tjebbeke » Sun May 15, 2016 9:49 am

If you are using the hosting template the dirs are used for sessions and as tmp upload dir.


https://github.com/serghey-rodin/vesta/ ... osting.tpl

Code: Select all

php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Top

xguntis
Posts: 30
Joined: Sat Mar 12, 2016 12:42 pm

Re: What files in user tmp directory?
  • Quote

Post by xguntis » Mon May 16, 2016 10:10 am

thanks for reply

if they are used for sessions - should the quantity of files only increase or also decrease? I can see it is always increasing. If so, they soon will consume all the inodes.

=== edit ===

After some googling i concluded that garbage collector for some reason was not working as expected. It just could not be that there are millions of unexpired sessions on a not so busy site. I deleted all the files manually and will keep an eye on that dir if it still is only growing.
re:
https://www.dev-metal.com/how-the-php-s ... lly-works/
Top

plutocrat
Posts: 232
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 17x
Web: apache + nginx
Re: What files in user tmp directory?
  • Quote

Post by plutocrat » Mon Dec 25, 2017 3:57 am

skurudo's suggestion in this thread seems sensible
viewtopic.php?t=13209

.. put this command in a weekly cronjob to keep them at bay

Code: Select all

find /home/*/tmp -type f -name 'sess_*' -ctime +5 -delete
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: What files in user tmp directory?
  • Quote

Post by mehargags » Mon Dec 25, 2017 7:04 pm

plutocrat wrote:skurudo's suggestion in this thread seems sensible
viewtopic.php?t=13209

.. put this command in a weekly cronjob to keep them at bay

Code: Select all

find /home/*/tmp -type f -name 'sess_*' -ctime +5 -delete
Yes Skurudo's suggestion works good. I usually setup a DAILY cron for root to clean all ../tmp sess* files older than 2 days. This helps to keep it clean
Top

plutocrat
Posts: 232
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 17x
Web: apache + nginx
Re: What files in user tmp directory?
  • Quote

Post by plutocrat » Tue Dec 26, 2017 1:56 am

xguntis wrote:I am waiting already half an hour to finish execution of command rm tmp/*.
You could try

Code: Select all

ls -1 -f | xargs rm
That works a lot quicker.
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password