المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : كلاود لينكس Cloud Linux استهلاك cagefs/tmp مساحة كبيرة clean up / delete



Rise Company
16-02-2024, 07:40
كلاود لينكس Cloud Linux استهلاك cagefs/tmp مساحة كبيرة clean up / delete
The huge size of the .cagefs directory - How to clean up CageFS /tmp files
It’s possible to delete tons of old sessions at /tmp folder?
Tmp files deleted accidentaly from CageFS folder. How to solve. Plz help!!!
I deleted all the files in my tmp folder and now my website says 'Error establishing a database connection'
How-to clean your /tmp directory with tmpwatch

https://www.rise.company/upload/uploads/170806443205411.png

المشكلة :

تجد موقع يستهلك مساحة كبيرة جدا رغم انها غير مستهلكة !
نعم داخل مجلد CageFS /tmp قد تجد ان مساحته 150 جيجا فقط
ومساحة الموقع نفسه فى public html هى 40 جيجا والايميلات 1 جيجا
لكن خارجهم فى CageFS /tmp هناك 15 جيجا مضافة !!

هل يمكنك حذف هذا المجلد ؟ طالما انها ملفات مؤقتة ؟
الاجابة نعم, لكن بعد الحذف هيوقف الموقع ويظهر لك خطا
'Error establishing a database connection'

حل المشكلة :

المجلد CageFS /tmp بداخله ملفات php مؤقتة للموقع وكذلك اتصال مع السيرفر
لا تحذف “mysql.sock” من داخل الفولدر , او اذا حذفت جميع الملفات اعمل ريستارت mysql
اذا لم يعمل اعمل ريستارت للسيرفر وهتجد ان المشكلة تم حلها.

restart database /restart server

-----------------------------------

حل اخر من خلال التنظيف Clean و ليس الحذف Delete
How-to clean your CageFS /tmp directory with tmpwatch
تم تجربة هذا الحل لم يحل مشكلة ازالة الملفات الكبيرة !

1. The high volume is most likely generated by temporary files. You can clean these files manually with


cagefsctl --tmpwatch


2. By default, the tmpwatch script cleans up users' /tmp directories every 30 days/720 hours.

3. You can change the time constraints of tmpwatch:


cagefsctl --set-tmpwatch='/usr/sbin/tmpwatch -umclq 720'


Where 720 is the number of hours that the file had to be inaccessible to be removed.
--------------------------------------------------------------------------------------------------------------------
By default, CageFS will clean up all the files that haven't been accessed in the last 30 days from the user's /tmp directory, however, this interval can be changed. You can set it to perform the cleaning every 6 hours, for instance, with the following command:



$ cagefsctl --set-tmpwatch='/usr/sbin/tmpwatch -umclq 6'


.cagefs directories contain CageFS configuration files so it is not recommended to remove them entirely. Most likely, there were some temporary files stuck, please check this documentation for more information:
https://docs.cloudlinux.com/shared/cloudlinux_os_components/#tmp-directories

To recreate .cagefs directory for a user, you can run:


cagefsctl -m USERNAME

To recreate .cagefs directory for all the users:


cagefsctl -M


المرجع:
https://cloudlinux.zendesk.com/hc/en-us/articles/4410830704018-The-huge-size-of-the-cagefs-directory

https://docs.cloudlinux.com/shared/cloudlinux_os_components/#tmp-directories
https://support.cpanel.net/hc/en-us/articles/360052677654-How-to-clean-your-tmp-directory-with-tmpwatch
https://support.cpanel.net/hc/en-us/articles/4407075781655-How-to-clean-up-CageFS-tmp-files
https://www.reddit.com/r/webhosting/comments/7gyi8j/help_i_deleted_all_the_files_in_my_tmp_folder_and/
https://wordpress.org/support/topic/help-i-deleted-all-the-files-in-my-tmp-folder-and-wp-are-broken/