I have an old server that was set up with only 10 GB of VAR space. The server VAR space is full. I have been searching around to see the best way to clear out this space. I did find an article on CSM (CPanel Server Management) that had a good set of instructions. I'm jut curious if emptying the mail queue is such a good idea.
Daniel, Only if you have a backup of it. You can run 'yum clean all' to clear out the yum cache, and rm -vf /var/log/*.{1,2,3,4,gz}* to remove old logfiles. You might also check the size of MySQL with du -shc /var/lib/mysql and see if there's maybe some tables that are able to be truncated like modsec or eximstats.
I'd advise against emptying the mail queue. Have a look at this article. It helps in clearing logs. https://documentation.cpanel.net/display/CKB/How+to+Manage+your+Hard+Drive+Space (Can't link it, probably due to post count).
This bash script might be helpful to combine said above and run all the operations to free up the disk space: # Delete error_log files larger then 10MB find /home/*/public_html/ -type f -name “error_log” -size +10M -delete # Delete Backups stored in /home/user/ folder for user in `/bin/ls -A /var/cpanel/users` ; do rm -fv /home/$user/backup-*$user.tar.gz ; done # Delete cPanel File Manager temp files rm -fv /home/*/tmp/Cpanel_* # Remove pure-ftp partials locate .pureftpd-upload | xargs rm -fv Save these commands into the file under /root/DiskCleanupScripts.sh and add cron job in /var/spool/cron/root file: 40 4 */2 * * /root/DiskCleanupScripts.sh So this will run every 2-nd day at 4:40am.