Freeing Up Disk Space with Root Access to the Server
This guide is intended for Utixo customers who have root access to their server and want to free up disk space by removing unnecessary or outdated files. Below are the key steps you can follow to optimize your server's storage.
Delete User cPanel Backups
If cPanel backup is enabled, some users may store their backup files directly in their home directories without deleting them afterward. This can quickly fill up disk space.
To delete user-generated .tar.gz backup files:
for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done
Remove File Manager Temporary Files
cPanel's File Manager creates temporary files during uploads. Sometimes these files are not automatically deleted. Use the following command to remove them:
rm -fv /home/*/tmp/Cpanel_*
Clean the /var/log/ Directory
The /var/log/ folder contains system and service logs. Many of these logs are stored in compressed formats (.gz or .1) and can take up considerable space if not maintained.
You can manually inspect and delete large files, or automate the process using commands like find or properly configuring logrotate to handle log rotation safely.
Clear Yum Cache
System updates performed via Yum leave behind cache and temporary package files. You can safely remove them using:
yum clean all
Warning
Always create a full backup before executing deletion commands. Accidentally removing system-critical files may compromise your server's stability and functionality.