Disk Cleanup is a function that helps you free up space on your server’s hard disk by deleting obsolete or temporary files. You should use this tool when your disk usage is high, or when you want to optimize your server’s performance.
Here is what it does:
- Disk Cleanup empties all web application access and error logs, which are files that record the requests and responses of your web applications. These files can grow large over time, and take up a lot of disk space.
- It removes all rotated logs of web applications and logs under
/var/log/
, which are older versions of the logs that are compressed and archived. These files are usually kept for backup or troubleshooting purposes, but you may not need them if you have other backup solutions, or if you don’t encounter any issues with your web applications. - It clears the apt cache, which is a folder that stores the downloaded packages and metadata of the software you install or update using the apt command. These files are useful for faster installation or reinstallation, but they can also accumulate over time and consume disk space.
- It clears the mysql bin log of files that are older than three days, which are files that record the changes made to your mysql database. These files are useful for replication or recovery purposes, but they can also grow large over time and take up disk space.
This function is safe to run in a production server, as it will not affect the functionality or data of your web applications or database. However, you should always make sure to have a backup of your important files before running any disk cleanup function.
How to Perform Disk Cleanup on RunCloud
You can run the disk cleanup utility directly from the RunCloud dashboard to clean up any obsolete files on your RunCloud server.
- Go to your server dashboard and switch to the “RunCloud Monitoring” tab. Here you can see the current server usage statistics.
- Click on the “…” button on the top right of the screen and select Disk Cleanup to initiate the disk cleanup process. This will open up a modal asking you to confirm your action.
- Click on “Clean” to confirm it. This will start the cleanup process in the background. The RunCloud agent will automatically locate and delete all of the obsolete files to release space.
After performing the disk cleanup, you can also read our guide on how to check disk usage on Linux and run automated scripts using bash for loops to delete files in Linux. If that’s not enough, then you can also consider increasing the size of persistent disk on your cloud VPS.