We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it soon. Read more about it: https://vestacp.com/docs/vesta-2-development
What files in user tmp directory?
What files in user tmp directory?
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?
What could be the reason of so many files in this directory?
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: What files in user tmp directory?
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
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
Re: What files in user tmp directory?
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/
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/
Re: What files in user tmp directory?
skurudo's suggestion in this thread seems sensible
viewtopic.php?t=13209
.. put this command in a weekly cronjob to keep them at bay
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
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: What files in user tmp directory?
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 cleanplutocrat 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
Re: What files in user tmp directory?
You could tryxguntis wrote:I am waiting already half an hour to finish execution of command rm tmp/*.
Code: Select all
ls -1 -f | xargs rm