Issue
The huge size of the .cagefs directory.
Environment
- CageFS
- DirectAdmin
- cPanel
- Plesk
Solution
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/cloudlinuxos/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
According to our docs:
https://docs.cloudlinux.com/cloudlinuxos/cloudlinux_os_components/#tmp-directories
It is recommended to create /etc/cagefs/cagefs.ini
file and specify a time interval for tmpwatch so it cleans up the user's /tmp directory from all the files that haven't been accessed for X hours:
# cat /etc/cagefs/cagefs.ini
[common]
tmpwatch = /usr/sbin/tmpwatch -umclq 72
72h = 3 days.
Note: cagefsctl --tmpwatch
cleans only files that have not been accessed during the period that one sets with tmpwatch = /usr/sbin/tmpwatch -umclq X
.
If you have a backup or other process that has accessed files, then they will not be deleted.
You may want to exclude the tmp directory from backup (if you have this kind of setup), it will save your space and time for backup.
Useful links
https://docs.cloudlinux.com/cloudlinuxos/cloudlinux_os_components/#tmp-directories
Comments
0 comments
Please sign in to leave a comment.