In the old days when hard drives were smaller, the /var partition was usually set to about 10gig. That was fine a long time ago, but now as space requirements/consumption increases, small /var partitions are starting to fill up much faster
For future reference if you get a new server, the /var partition should be at least 50gig or should be on the / partition with sufficient space.
In the meantime, here’s a few ways to clean up /var
- Clear old logs from /var/log/
There’s usually several log rotations kept here. You can safely remove the old rotated backups here. - Empty the mail queue
This can be done from WHM in the Mail Queue Manager or in ssh by emptying /var/spool/exim/ folders - The cpanel bandwidth folder can grow pretty large
If you are not concerned with bandwidth tracking, you can clear out /var/cpanel/bandwidth/ - Other non-vital areas that often consume a lot of space that can be removed are the eximstats db, logwatch cache folder, etc.
Since the /var partition holds a lot of logs, databases, mail queue, etc., it is completely normal to fill up over time. Depending on how many sites you have and how much activity you have, you may have to clean it up every few weeks. The average usage on a /var partition that is 10gig is about 50% used.
If the /var usage is still too high, you can type
du -sh /var/*
to find out which folder is using the most and dig deeper into the folders.
As a last resort if /var is still too full, MySQL can safely be moved to another partition but this should only be done if you are fully experienced with ssh.
Standby, we will cover cleaning up other partitions and moving MySQL is an upcoming post 🙂