{"id":34125,"date":"2021-09-30T16:08:59","date_gmt":"2021-09-30T16:08:59","guid":{"rendered":"https:\/\/www.hostduplex.com\/kb\/?post_type=ht_kb&#038;p=34125"},"modified":"2021-09-30T16:21:32","modified_gmt":"2021-09-30T16:21:32","slug":"how-to-clean-up-cpanel-disk-space","status":"publish","type":"ht_kb","link":"https:\/\/www.hostduplex.com\/kb\/article\/how-to-clean-up-cpanel-disk-space\/","title":{"rendered":"How to clean up cPanel disk space"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">Having a full disk can interfere with the speed and efficiency of our server. You may experience downtime, slow website loading, emails not arriving to your mailbox. The tips below will help you free disk space and maximize your account&#8217;s potential.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">1. \u00a0Delete user cPanel backups<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">cPanel has a backup feature available. If enabled, a copy of your cPanel control panel settings and other data will be stored in the backup folder. On larger servers, this folder could take up a lot of disk space.\u00a0In that case, the best way to free up the disk space in cPanel is by deleting some data from the backup folder. You can either delete the data one-by-one or mass-delete the entire user cPanel.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">You can mass-delete all user cPanel backups on the server with this command via SSH:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">for user in `\/bin\/ls -A \/var\/cpanel\/users` ; do rm -fv \/home\/$user\/backup-*$user.tar.gz ; done<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">2. \u00a0Move your backups offsite<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">On the other hand, you should consider mounting a backup server to your hosting server and storing the backups there (there is an option to mount external media in WHM &gt; Configure Backups) or using an alternate method of backing up your server that doesn\u2019t involve storing the backups locally. While local backups may be convenient at times, they tend to be useless when a server failure occurs.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">3. Delete cPanel File Manager temp files<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">When users upload files in the File Manager within cPanel, it creates a temp file that may or may not get removed upon upload. You can remove these files using this command via SSH:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">rm -fv \/home\/*\/tmp\/Cpanel_*<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">4. Move or archive logs<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Most of the server\u2019s logs are stored in \/var\/log, which can get large on more populated servers. You can change the length of time and frequency of the log rotation in \/etc\/logrotate.conf, and enable compression to save additional space (at the expense of CPU when the logs are being gzipped). If you want older logs, consider creating a cron job to periodically transfer them to a backup or log server so they aren\u2019t taking up space on your hosting account.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">5. Clean up Yum files<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yum updates leave package cache files on the server. You can clean up all unneeded yum files by running:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">yum clean all<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">6. Remove pure-ftp partials<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">When your users upload files to the server via FTP when your server runs pureFTP as an FTP daemon, the FTP server creates temporary files starting with .pureftpd-upload* that get renamed the the actual filename when the upload completes. If the upload doesn\u2019t complete, these files are left on the server. You can find and delete these by running this command via SSH:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">locate .pureftpd-upload | xargs rm -fv<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"HowToFreeDiskSpaceOncPanelWHMServer-11.Consideralargerserver\">7. Consider upgrading the disk server on your account<\/h4>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">You may have a legitimate need for a large amount of disk space, and therefore you may be unable to keep the disk space usage on your account at a reasonable level. A lot of hosting providers have alternate servers that don\u2019t have as much in the way of resources but have huge disk storage volumes to accommodate customers that have larger sites. You might want to consider investing in a higher disk capacity.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Having a full disk can interfere with the speed and efficiency of our server. You may experience downtime, slow website loading, emails not arriving to your mailbox. The tips below will help you free disk space and maximize your account&#8217;s potential. 1. \u00a0Delete user cPanel backups cPanel has a backup&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[20],"ht-kb-tag":[160,23,159],"class_list":["post-34125","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cpanel","ht_kb_tag-clean","ht_kb_tag-cpanel","ht_kb_tag-disk-space"],"_links":{"self":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/comments?post=34125"}],"version-history":[{"count":12,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34125\/revisions"}],"predecessor-version":[{"id":34139,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34125\/revisions\/34139"}],"wp:attachment":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/media?parent=34125"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=34125"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=34125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}