KNOWNHOST WIKI

User Tools

Site Tools


general:disk-space-management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
general:disk-space-management [2019/11/04 15:03]
dbarber [Troubleshooting via SSH]
general:disk-space-management [2020/06/01 15:28] (current)
Karson N.
Line 3: Line 3:
 It is important to make sure that the server does not fully run out of disk space. If it does, the services running in the server will quit working, and some of the database tables could even become corrupted. Here are some things to consider, to help ensure that your server has enough disk space to work correctly. It is important to make sure that the server does not fully run out of disk space. If it does, the services running in the server will quit working, and some of the database tables could even become corrupted. Here are some things to consider, to help ensure that your server has enough disk space to work correctly.
  
 +\\
 ===== Backups ===== ===== Backups =====
  
-Although backups do themselves take disk space, it is still very important to have them. To protect against data loss, it is always strongly recommended not only to keep multiple sets of backups, but also to keep copies of at least some of them in an offsite location. Although we do create our own [[vps-hosting:information-about-vps-backups-and-restorations|backups of the VPSs]], there are multiple reasons it is important not only for you to create your own backups as well, but also to keep at least one of the copies offsite.+Although backups do themselves take disk space, it is still very important to have them. To protect against data loss, it is always strongly recommended not only to keep multiple sets of backups, but also to keep copies of at least some of them in an offsite location. Although we do create our own 
 +[[vps-hosting:information-about-vps-backups-and-restorations|backups of the VPSs]], 
 +there are multiple reasons it is important not only for you to create your own backups as well, but also to keep at least one of the copies offsite.
  
-For cPanel/WHM servers, you can read more about how to configure automatic backups and some of our recommendations for them [[control-panels:cpanel-whm:backup-configuration|here]]. For manually triggering backups at the time you want them via cPanel, you can read more [[https://documentation.cpanel.net/display/ALD/Backup+Wizard|here]]. For DirectAdmin servers, you can configure backups from [[https://help.directadmin.com/item.php?id=269|any of the three access levels]] and it is possible to [[https://help.directadmin.com/item.php?id=511|store the generated backup both locally and remotely]]. For servers still using Plesk,((Plesk is no longer available for new servers)) you can learn more about the backup system [[http://docs.plesk.com/en-US/12.5/advanced-administration-guide-linux/backing-up-restoring-and-migrating-data/backing-up-data.68837/|here]].+For cPanel/WHM servers, you can read more about how to configure automatic backups and some of our recommendations for them [[control-panels:cpanel-whm:backup-configuration|here]]. 
 +For manually triggering backups at the time you want them via cPanel, you can read more 
 +((https://documentation.cpanel.net/display/ALD/Backup+Wizard)) 
 +[[https://documentation.cpanel.net/display/ALD/Backup+Wizard|here]]. 
 +For DirectAdmin servers, you can configure backups from 
 +((https://help.directadmin.com/item.php?id=269)) 
 +[[https://help.directadmin.com/item.php?id=269|any of the three access levels]] 
 +and it is possible to 
 +((https://help.directadmin.com/item.php?id=511)) 
 +[[https://help.directadmin.com/item.php?id=511|store the generated backup both locally and remotely]]. 
 +For servers still using Plesk, (Plesk is no longer available for new servers) you can learn more about the backup system 
 +((http://docs.plesk.com/en-US/12.5/advanced-administration-guide-linux/backing-up-restoring-and-migrating-data/backing-up-data.68837/)) 
 +[[http://docs.plesk.com/en-US/12.5/advanced-administration-guide-linux/backing-up-restoring-and-migrating-data/backing-up-data.68837/|here]].
  
 <WRAP important> <WRAP important>
Line 22: Line 37:
   * How long ago you want to be able to revert accounts to   * How long ago you want to be able to revert accounts to
  
-For more specific recommendations,((for cPanel/WHM servers)) please read more [[control-panels:cpanel-whm:backup-configuration|here]].+For more specific recommendations, (for cPanel/WHM servers) please read more 
 +[[control-panels:cpanel-whm:backup-configuration|here]].
  
 +\\
 ===== Account Quotas ===== ===== Account Quotas =====
  
-One way to help prevent the server from running out of disk space is by using account quotas to limit how much disk space each account is allowed to use. In cPanel, the quota for a specific account can be adjusted in WHM at ''Home >> Account Information >> List Accounts'' by clicking the plus (+) button next to the desired account, clicking the "Change Quota" button that then appears under the account information, and using the interface there.+One way to help prevent the server from running out of disk space is by using account quotas to limit how much disk space each account is allowed to use. In cPanel, the quota for a specific account can be adjusted in WHM at 
 +<code> 
 +  Home >> Account Information >> List Accounts 
 +</code> 
 + 
 +by clicking the plus (+) button next to the desired account, clicking the "Change Quota" button that then appears under the account information, and using the interface there.
  
 It is strongly recommended to have a quota on each account, and for the sum of the account quotas to be enough less than the total size of the server to leave room for the system files. It is strongly recommended to have a quota on each account, and for the sum of the account quotas to be enough less than the total size of the server to leave room for the system files.
  
-It is important to note that with default settings, database sizes are not calculated. This setting is chosen as default for performance reasons, since there is considerable overhead with calculating database sizes. For this reason, the database sizes are by default displayed as zero, and do not count against the accounts' disk space quotas. They do, however, still take up space on the disk. For this reason, with default settings, it is possible for the accounts to use more disk space than they have been allocated. To prevent this from happening, you could enable database size calculations by setting "Include databases in disk usage calculations" to "On" in WHM at ''Home >> Server Configuration >> Tweak Settings -> SQL''But remember that this is likely to slow down the server, so you will need to decide for your server how likely it is for database disk space usage to become a problem vs. database disk space calculation to cause a problem with server load, or which issue you would rather risk happening.+It is important to note that with default settings, database sizes are not calculated. This setting is chosen as default for performance reasons, since there is considerable overhead with calculating database sizes. For this reason, the database sizes are by default displayed as zero, and do not count against the accounts' disk space quotas. They do, however, still take up space on the disk. For this reason, with default settings, it is possible for the accounts to use more disk space than they have been allocated. To prevent this from happening, you could enable database size calculations by setting "Include databases in disk usage calculations" to "On" in WHM at 
 +<code> 
 +  Home >> Server Configuration >> Tweak Settings -> SQL 
 +</code> 
 + 
 +But remember that this is likely to slow down the server, so you will need to decide for your server how likely it is for database disk space usage to become a problem vs. database disk space calculation to cause a problem with server load, or which issue you would rather risk happening.
  
 It is also important to note that (in a cPanel server) files owned by "nobody" will not count against the cPanel user's disk space quota. This is yet another reason to use mod_ruid2 (or, if this is not possible, suphp) so that the site files will be correctly owned by the cPanel user. It is also important to note that (in a cPanel server) files owned by "nobody" will not count against the cPanel user's disk space quota. This is yet another reason to use mod_ruid2 (or, if this is not possible, suphp) so that the site files will be correctly owned by the cPanel user.
  
 +\\
 ===== Monitoring and Troubleshooting ===== ===== Monitoring and Troubleshooting =====
  
-It is strongly recommended to keep an eye on how much disk space the server is using, to help ensure it does not completely fill up its disk. On a cPanel server, it is strongly recommended to enable all of the following settings in WHM at ''Home >> Server Configuration >> Tweak Settings'' in the section "Notifications", to help keep you and your resellers/site admins informed when the disk space usage needs attention:+It is strongly recommended to keep an eye on how much disk space the server is using, to help ensure it does not completely fill up its disk. On a cPanel server, it is strongly recommended to enable all of the following settings in WHM at 
 +<code> 
 +  Home >> Server Configuration >> Tweak Settings 
 +</code> 
 + 
 +in the section "Notifications", to help keep you and your resellers/site admins informed when the disk space usage needs attention:
  
   * System disk space usage warnings   * System disk space usage warnings
Line 59: Line 92:
 If more disk space is being used than expected, it is recommended to check what is using the disk space. Where to check first will depend on how you find out about it. If more disk space is being used than expected, it is recommended to check what is using the disk space. Where to check first will depend on how you find out about it.
  
-If the server has used up enough of its disk space overall that it is causing services (daemons) to be interrupted, you might not be able to use the cPanel((or DirectAdmin or Plesk, as applicable)) interface to investigate. Sometimes even if the panel is not working, you will be able to connect using [[software:how-can-i-use-putty-software-to-ssh-to-my-cpanel-server|SSH]]. If SSH is not working either, you can [[my-knownhost:howto-login|open a Support Ticket]] for assistance 24x7x365.+If the server has used up enough of its disk space overall that it is causing services (daemons) to be interrupted, you might not be able to use the cPanel (or DirectAdmin or Plesk, as applicable) interface to investigate. Sometimes even if the panel is not working, you will be able to connect using 
 +[[software:how-can-i-use-putty-software-to-ssh-to-my-cpanel-server|SSH]]. 
 +If SSH is not working either, you can 
 +[[my-knownhost:howto-login|open a Support Ticket]] 
 +for assistance 24x7x365.
  
 +\\
 ==== Troubleshooting via SSH ==== ==== Troubleshooting via SSH ====
  
 {{howhard>4}} {{howhard>4}}
  
-<WRAP important> If you are not //able// to log into cPanel/WHM,((or DirectAdmin or Plesk, as applicable)) it is **strongly** recommended to open a Support Ticket for assistance, unless you are very comfortable with ssh, enough to attempt to resolve the issue on your own. It is important to be **extremely** careful if attempting to resolve disk space issues yourself, since it is possible to remove wrong files, thereby breaking server functionality. </WRAP>+<WRAP important> If you are not //able// to log into cPanel/WHM, (or DirectAdmin or Plesk, as applicable) it is **strongly** recommended to open a Support Ticket for assistance, unless you are very comfortable with ssh, enough to attempt to resolve the issue on your own. It is important to be **extremely** careful if attempting to resolve disk space issues yourself, since it is possible to remove wrong files, thereby breaking server functionality. </WRAP>
  
 If you are logged into ssh as root, you can check the server's overall disk space usage with the ''%%df%%'' utility. For example, you can check the disk space usage in the root ''%%/%%'' partition as follows: If you are logged into ssh as root, you can check the server's overall disk space usage with the ''%%df%%'' utility. For example, you can check the disk space usage in the root ''%%/%%'' partition as follows:
  
 <code> <code>
-root@host [~]# df -h / +  root@host [~]# df -h / 
-Filesystem      Size  Used Avail Use% Mounted on +  Filesystem      Size  Used Avail Use% Mounted on 
-/dev/simfs       50G   34G   17G  68% /+  /dev/simfs       50G   34G   17G  68% /
 </code> </code>
  
Line 80: Line 118:
  
 <code> <code>
-# df -h /backup+  # df -h /backup
 </code> </code>
  
Line 88: Line 126:
  
 <code> <code>
-root@host [~/support]# find /backup -type d -name accounts -print0 | xargs -0 du -sch | sort -h +  root@host [~/support]# find /backup -type d -name accounts -print0 | xargs -0 du -sch | sort -h 
-4.0K /backup/2017-07-02/accounts +  4.0K   /backup/2017-07-02/accounts 
-4.0K /backup/2017-07-03/accounts +  4.0K   /backup/2017-07-03/accounts 
-4.0K /backup/2017-07-04/accounts +  4.0K   /backup/2017-07-04/accounts 
-4.0K /backup/2017-07-05/accounts +  4.0K   /backup/2017-07-05/accounts 
-4.0K /backup/2017-07-06/accounts +  4.0K   /backup/2017-07-06/accounts 
-4.0K /backup/2017-07-07/accounts +  4.0K   /backup/2017-07-07/accounts 
-4.0K /backup/monthly/2017-07-01/accounts +  4.0K   /backup/monthly/2017-07-01/accounts 
-4.0K /backup/weekly/2017-06-25/accounts +  4.0K   /backup/weekly/2017-06-25/accounts 
-4.0K /backup/weekly/2017-07-02/accounts +  4.0K   /backup/weekly/2017-07-02/accounts 
-5.0G /backup/monthly/2017-06-01/accounts +  5.0G   /backup/monthly/2017-06-01/accounts 
-5.0G /backup/monthly/2017-06-15/accounts +  5.0G   /backup/monthly/2017-06-15/accounts 
-10G total+  10G   total
 </code> </code>
  
Line 112: Line 150:
  
 <code> <code>
-# repquota -as+  # repquota -as
 </code> </code>
  
Line 118: Line 156:
  
 <code> <code>
-root@host [~]# repquota -as | head +  root@host [~]# repquota -as | head 
-*** Report for user quotas on device /dev/simfs +  *** Report for user quotas on device /dev/simfs 
-Block grace time: 00:00; Inode grace time: 00:00+  Block grace time: 00:00; Inode grace time: 00:00
                         Block limits                File limits                         Block limits                File limits
-User            used    soft    hard  grace    used  soft  hard  grace +  User            used    soft    hard  grace    used  soft  hard  grace 
----------------------------------------------------------------------- +  ---------------------------------------------------------------------- 
-root      --  29533M                       246k                +  root      --  29533M                       246k                
-bin       --   44980                         70                +  bin       --   44980                         70                
-daemon    --      28                          6                +  daemon    --      28                          6                
-nobody    --    144M                      36320                +  nobody    --    144M                      36320                
-mailnull  --    2732                        197               +  mailnull  --    2732                        197               
 </code> </code>
  
Line 138: Line 176:
  
 <code> <code>
-root@host [~]# cd /path/to/folder/ +  root@host [~]# cd /path/to/folder/ 
-root@host [/path/to/folder]# du -hd 1 . +  root@host [/path/to/folder]# du -hd 1 . 
-932K ./.cphorde +  932K   ./.cphorde 
-84K ./etc +  84K   ./etc 
-8.0K ./.sqmaildata +  8.0K   ./.sqmaildata 
-4.0K ./.trash +  4.0K   ./.trash 
-12K ./.htpasswds +  12K   ./.htpasswds 
-20K ./.ssh +  20K   ./.ssh 
-4.0K ./perl5 +  4.0K   ./perl5 
-8.0K ./.subaccounts +  8.0K   ./.subaccounts 
-63M ./public_html +  63M   ./public_html 
-636M ./mail +  636M   ./mail 
-8.5M ./.git +  8.5M   ./.git 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-62M ./tmp +  62M   ./tmp 
-24K ./ssl +  24K   ./ssl 
-580K ./.cpanel +  580K   ./.cpanel 
-80K ./cache +  80K   ./cache 
-8.0K ./public_ftp +  8.0K   ./public_ftp 
-8.0K ./.cpaddons +  8.0K   ./.cpaddons 
-630M ./logs +  630M   ./logs 
-4.0K ./.sqmailattach +  4.0K   ./.sqmailattach 
-100K ./.razor +  100K   ./.razor 
-1.4G .+  1.4G    .
 </code> </code>
  
Line 167: Line 205:
  
 <code> <code>
-root@host [/path/to/folder]# du -hd 1 . | sort -h | tail +  root@host [/path/to/folder]# du -hd 1 . | sort -h | tail 
-100K ./.razor +  100K   ./.razor 
-580K ./.cpanel +  580K   ./.cpanel 
-932K ./.cphorde +  932K   ./.cphorde 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-8.5M ./.git +  8.5M   ./.git 
-62M ./tmp +  62M   ./tmp 
-63M ./public_html +  63M   ./public_html 
-630M ./logs +  630M   ./logs 
-636M ./mail +  636M   ./mail 
-1.4G .+  1.4G   .
 </code> </code>
  
Line 183: Line 221:
  
 <code> <code>
-root@host [/path/to/folder]# du -had 1 . +  root@host [/path/to/folder]# du -had 1 . 
-932K ./.cphorde +  932K   ./.cphorde 
-4.0K ./.contactemail +  4.0K   ./.contactemail 
-84K ./etc +  84K   ./etc 
-8.0K ./.sqmaildata +  8.0K   ./.sqmaildata 
-4.0K ./.trash +  4.0K   ./.trash 
-12K ./.htpasswds +  12K   ./.htpasswds 
-20K ./.ssh +  20K   ./.ssh 
-4.0K ./perl5 +  4.0K   ./perl5 
-4.0K ./.bash_logout +  4.0K   ./.bash_logout 
-8.0K ./.subaccounts +  8.0K   ./.subaccounts 
-4.0K ./.bashrc +  4.0K   ./.bashrc 
-4.0K ./.ftpquota +  4.0K   ./.ftpquota 
-4.0K ./.bash_profile +  4.0K   ./.bash_profile 
-63M ./public_html +  63M   ./public_html 
-636M ./mail +  636M   ./mail 
-4.0K ./.lastlogin +  4.0K   ./.lastlogin 
-0 ./access-logs +  0   ./access-logs 
-8.5M ./.git +  8.5M   ./.git 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-0 ./www +  0   ./www 
-62M ./tmp +  62M   ./tmp 
-24K ./ssl +  24K   ./ssl 
-0 ./README +  0   ./README 
-580K ./.cpanel +  580K   ./.cpanel 
-4.0K ./.dns +  4.0K   ./.dns 
-4.0K ./.gitconfig +  4.0K   ./.gitconfig 
-80K ./cache +  80K   ./cache 
-8.0K ./.bash_history +  8.0K   ./.bash_history 
-8.0K ./public_ftp +  8.0K   ./public_ftp 
-4.0K ./.gitignore +  4.0K   ./.gitignore 
-8.0K ./.cpaddons +  8.0K   ./.cpaddons 
-630M ./logs +  630M   ./logs 
-4.0K ./.sqmailattach +  4.0K   ./.sqmailattach 
-4.0K ./cpbackup-exclude.conf +  4.0K   ./cpbackup-exclude.conf 
-100K ./.razor +  100K   ./.razor 
-4.0K ./.my.cnf +  4.0K   ./.my.cnf 
-1.4G .+  1.4G   .
 </code> </code>
  
Line 226: Line 264:
  
 <code> <code>
-root@host [/path/to/folder]# du -had 1 . | sort -h | tail +  root@host [/path/to/folder]# du -had 1 . | sort -h | tail 
-100K ./.razor +  100K   ./.razor 
-580K ./.cpanel +  580K   ./.cpanel 
-932K ./.cphorde +  932K   ./.cphorde 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-8.5M ./.git +  8.5M   ./.git 
-62M ./tmp +  62M   ./tmp 
-63M ./public_html +  63M   ./public_html 
-630M ./logs +  630M   ./logs 
-636M ./mail +  636M   ./mail 
-1.4G .+  1.4G   .
 </code> </code>
  
Line 244: Line 282:
  
 <code> <code>
-root@host [/path/to/folder]# ls -hl temp +  root@host [/path/to/folder]# ls -hl temp 
--rw-r--r-- 1 root root 1.0G Jul 31 10:38 temp+  -rw-r--r-- 1 root root 1.0G Jul 31 10:38 temp
 </code> </code>
  
Line 251: Line 289:
  
 <code> <code>
-root@host [/path/to/folder]# du -hd 1 . | sort -h | tail +  root@host [/path/to/folder]# du -hd 1 . | sort -h | tail 
-100K ./.razor +  100K   ./.razor 
-580K ./.cpanel +  580K   ./.cpanel 
-932K ./.cphorde +  932K   ./.cphorde 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-8.5M ./.git +  8.5M   ./.git 
-63M ./tmp +  63M   ./tmp 
-65M ./public_html +  65M   ./public_html 
-634M ./logs +  634M   ./logs 
-637M ./mail +  637M   ./mail 
-2.4G .+  2.4G   .
 </code> </code>
  
Line 267: Line 305:
  
 <code> <code>
-root@host [/path/to/folder]# du -had 1 . | sort -h | tail +  root@host [/path/to/folder]# du -had 1 . | sort -h | tail 
-580K ./.cpanel +  580K   ./.cpanel 
-932K ./.cphorde +  932K   ./.cphorde 
-2.2M ./.spamassassin +  2.2M   ./.spamassassin 
-8.5M ./.git +  8.5M   ./.git 
-63M ./tmp +  63M   ./tmp 
-65M ./public_html +  65M   ./public_html 
-634M ./logs +  634M   ./logs 
-637M ./mail +  637M   ./mail 
-1.1G ./temp +  1.1G   ./temp 
-2.4G .+  2.4G   .
 </code> </code>
  
 +\\
 ==== Troubleshooting via cPanel/WHM ==== ==== Troubleshooting via cPanel/WHM ====
  
Line 286: Line 325:
 <WRAP info> This section assumes a cPanel server. If your server uses DirectAdmin or Plesk, you will need to instead use the equivalent functions in your panel. </WRAP> <WRAP info> This section assumes a cPanel server. If your server uses DirectAdmin or Plesk, you will need to instead use the equivalent functions in your panel. </WRAP>
  
-If you are able to still log into WHM and cPanel, you can use the "[[https://documentation.cpanel.net/display/ALD/List+Accounts|List Accounts]]" interface in WHM at Home >> Account Information >> List Accounts to see how much space each account is currently taking. You can even sort the accounts by disk space usage by clicking the title of the "Disk Used" column. Note that if databases are not being included in quota calculations, the accounts are likely taking more space than will be displayed here.+If you are able to still log into WHM and cPanel, you can use the 
 +((https://documentation.cpanel.net/display/ALD/List+Accounts)) 
 +"[[https://documentation.cpanel.net/display/ALD/List+Accounts|List Accounts]]" 
 +interface in WHM at 
 +<code> 
 +  Home >> Account Information >> List Accounts 
 +</code> 
 + 
 +to see how much space each account is currently taking. You can even sort the accounts by disk space usage by clicking the title of the "Disk Used" column. Note that if databases are not being included in quota calculations, the accounts are likely taking more space than will be displayed here.
  
-If there is an account in particular you would like to investigate, you can click on the "cP" icon of the row in the "cPanel" column, to open the cPanel interface for the account. From there, you can go to the "[[https://documentation.cpanel.net/display/ALD/Disk+Usage|Disk Usage]]" page in the "Files" section, to see a breakdown of approximately how that account is using its disk space. How to proceed from there depends heavily on what category is using most of the disk space.+If there is an account in particular you would like to investigate, you can click on the "cP" icon of the row in the "cPanel" column, to open the cPanel interface for the account. From there, you can go to the 
 +((https://documentation.cpanel.net/display/ALD/Disk+Usage)) 
 +"[[https://documentation.cpanel.net/display/ALD/Disk+Usage|Disk Usage]]" 
 +page in the "Files" section, to see a breakdown of approximately how that account is using its disk space. How to proceed from there depends heavily on what category is using most of the disk space.
  
 +\\
 ==== Temporary Files ==== ==== Temporary Files ====
  
Line 297: Line 348:
  
 <code> <code>
-# find /tmp -type f -print0 | xargs -0 du -sch | sort -h | tail+  # find /tmp -type f -print0 | xargs -0 du -sch | sort -h | tail
 </code> </code>
  
Line 303: Line 354:
  
 <code> <code>
-# find /tmp -type f -exec rm -v {} ++  # find /tmp -type f -exec rm -v {} +
 </code> </code>
  
 +\\
 ==== Trash Folders - cPanel File Manager ==== ==== Trash Folders - cPanel File Manager ====
  
-cPanel File Manager has a trash folder for each account, so that if something is deleted by accident from the File Manager, it can be brought back relatively easily. But, this trash folder is not automatically emptied. If any of your users make extensive use of the File Manager in cPanel, especially if they do not often use the [[https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-Deleteandrestorefilesandfolders|Empty Trash]] button within File Manager, it is possible that these trash folders can get quite large.+cPanel File Manager has a trash folder for each account, so that if something is deleted by accident from the File Manager, it can be brought back relatively easily. But, this trash folder is not automatically emptied. If any of your users make extensive use of the File Manager in cPanel, especially if they do not often use the 
 +((https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-Deleteandrestorefilesandfolders)) 
 +[[https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-Deleteandrestorefilesandfolders|Empty Trash]] 
 +button within File Manager, it is possible that these trash folders can get quite large.
  
 +\\
 === via cPanel === === via cPanel ===
  
Line 316: Line 372:
 These trash folders can be emptied within cPanel File Manager by clicking the "Empty Trash" button. These trash folders can be emptied within cPanel File Manager by clicking the "Empty Trash" button.
  
 +\\
 === via SSH === === via SSH ===
  
Line 323: Line 380:
  
 <code> <code>
-root@host [~]# du -sch /home*/*/.trash | sort -h | tail +  root@host [~]# du -sch /home*/*/.trash | sort -h | tail 
-4.0K /home/user1/.trash +  4.0K   /home/user1/.trash 
-4.0K /home/user2/.trash +  4.0K   /home/user2/.trash 
-4.0K /home/user3/.trash +  4.0K   /home/user3/.trash 
-12K total+  12K   total
 </code> </code>
  
Line 333: Line 390:
  
 <code> <code>
-# find /home*/*/.trash -depth -mindepth 1 \( \( ! -type d -exec rm -v {} + \) -o \( -exec rmdir -v {} + \) \)+  # find /home*/*/.trash -depth -mindepth 1 \( \( ! -type d -exec rm -v {} + \) -o \( -exec rmdir -v {} + \) \)
 </code> </code>
  
 +\\
 ==== Trash Folders - IMAP ==== ==== Trash Folders - IMAP ====
  
 If your users use IMAP to connect to their mail folders, then when they delete messages via their mail client they will usually at first be moved to a trash folder. In cPanel servers, it is possible to configure the IMAP trash folders to "Autoexpunge", which means that messages which have been in these trash folders a certain number of days will be automatically removed. Within the filesystem, these folders are named ''%%.Trash%%'', capitalized, rather than lowercase like the File Manager trash folders. If your users use IMAP to connect to their mail folders, then when they delete messages via their mail client they will usually at first be moved to a trash folder. In cPanel servers, it is possible to configure the IMAP trash folders to "Autoexpunge", which means that messages which have been in these trash folders a certain number of days will be automatically removed. Within the filesystem, these folders are named ''%%.Trash%%'', capitalized, rather than lowercase like the File Manager trash folders.
  
 +\\
 === Autoexpunge === === Autoexpunge ===
  
Line 346: Line 405:
 In a cPanel server, The "Autoexpunge" option can be found in WHM at ''%%Home >> Service Configuration >> Mailserver Configuration%%''. Also on this page is the option "Trash Expire Time" which controls how many days old a message is kept in the trash folder before it is automatically removed. In a cPanel server, The "Autoexpunge" option can be found in WHM at ''%%Home >> Service Configuration >> Mailserver Configuration%%''. Also on this page is the option "Trash Expire Time" which controls how many days old a message is kept in the trash folder before it is automatically removed.
  
 +\\
 === via cPanel === === via cPanel ===
  
 {{howhard>3}} {{howhard>3}}
  
-In order to find these ''%%.Trash%%'' folders within the File Manager, it is necessary first to make sure "Show Hidden Files (dotfiles)" is enabled in the [[https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-ChangeSettings|Settings]]. Once this has been done, you should be able to find the folders in their locations. There are two places to look:+In order to find these ''%%.Trash%%'' folders within the File Manager, it is necessary first to make sure "Show Hidden Files (dotfiles)" is enabled in the 
 +((https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-ChangeSettings)) 
 +[[https://documentation.cpanel.net/display/ALD/File+Manager#FileManager-ChangeSettings|Settings]]. 
 +Once this has been done, you should be able to find the folders in their locations. There are two places to look:
  
   * directly in the "mail" folder, that is, ''%%mail/.Trash%%'' and   * directly in the "mail" folder, that is, ''%%mail/.Trash%%'' and
Line 357: Line 420:
 If you started File Manager from the site's docroot, ((aka, the www or public_html folder)) you will need to go up one level in order to see the mail folder. If you started File Manager from the site's docroot, ((aka, the www or public_html folder)) you will need to go up one level in order to see the mail folder.
  
 +\\
 === via Webmail === === via Webmail ===
  
 {{howhard>3}} {{howhard>3}}
  
-//If// you have **not** yet enabled the new [[https://documentation.cpanel.net/display/ALD/Mailbox+Conversion|mdbox]] mailbox format, you can see the contents of the email accounts from the webmail interface of the overarching email account of the cPanel account [[https://documentation.cpanel.net/display/ALD/Email+Accounts#EmailAccounts-Defaultemailaccount|itself]]. You may need to "subscribe" to the relevant folders in the settings within the preferred webmail application. But, if you have already converted from maildir format to the new mdbox format, the symlinks necessary for this method of access will not work.+//If// you have **not** yet enabled the new 
 +((https://documentation.cpanel.net/display/ALD/Mailbox+Conversion)) 
 +[[https://documentation.cpanel.net/display/ALD/Mailbox+Conversion|mdbox]] 
 +mailbox format, you can see the contents of the email accounts from the webmail interface of the overarching email account of the cPanel account 
 +((https://documentation.cpanel.net/display/ALD/Email+Accounts#EmailAccounts-Defaultemailaccount)) 
 +[[https://documentation.cpanel.net/display/ALD/Email+Accounts#EmailAccounts-Defaultemailaccount|itself]]. 
 +You may need to "subscribe" to the relevant folders in the settings within the preferred webmail application. But, if you have already converted from maildir format to the new mdbox format, the symlinks necessary for this method of access will not work.
  
 +\\
 === via SSH === === via SSH ===
  
Line 370: Line 441:
  
 <code> <code>
-root@host [~]# du -sch /home*/*/mail/{*/*/,}.Trash | sort -h | tail +  root@host [~]# du -sch /home*/*/mail/{*/*/,}.Trash | sort -h | tail 
-16K /home/user1/mail/.Trash +  16K   /home/user1/mail/.Trash 
-16K /home/user2/mail/.Trash +  16K   /home/user2/mail/.Trash 
-16K /home/user3/mail/.Trash +  16K   /home/user3/mail/.Trash 
-16K /home/user4/mail/.Trash +  16K   /home/user4/mail/.Trash 
-16K /home/user5/mail/.Trash +  16K   /home/user5/mail/.Trash 
-16K /home/user6/mail/.Trash +  16K   /home/user6/mail/.Trash 
-24K /home/user7/mail/.Trash +  24K   /home/user7/mail/.Trash 
-32K /home/user7/mail/domain.tld/address1/.Trash +  32K   /home/user7/mail/domain.tld/address1/.Trash 
-436K /home/user7/mail/domain.tld/address2/.Trash +  436K   /home/user7/mail/domain.tld/address2/.Trash 
-604K total+  604K   total
 </code> </code>
  
Line 388: Line 459:
  
 <code> <code>
-root@host [~]# du -sch /home*/*/{.trash,mail/{*/*/,}.Trash} | sort -h | tail +  root@host [~]# du -sch /home*/*/{.trash,mail/{*/*/,}.Trash} | sort -h | tail 
-16K /home/user1/mail/.Trash +  16K   /home/user1/mail/.Trash 
-16K /home/user2/mail/.Trash +  16K   /home/user2/mail/.Trash 
-16K /home/user3/mail/.Trash +  16K   /home/user3/mail/.Trash 
-16K /home/user4/mail/.Trash +  16K   /home/user4/mail/.Trash 
-16K /home/user5/mail/.Trash +  16K   /home/user5/mail/.Trash 
-16K /home/user6/mail/.Trash +  16K   /home/user6/mail/.Trash 
-24K /home/user7/mail/.Trash +  24K   /home/user7/mail/.Trash 
-32K /home/user7/mail/domain.tld/address1/.Trash +  32K   /home/user7/mail/domain.tld/address1/.Trash 
-436K /home/user7/mail/domain.tld/address2/.Trash +  436K   /home/user7/mail/domain.tld/address2/.Trash 
-616K total+  616K   total
 </code> </code>
  
Line 406: Line 477:
  
 <code> <code>
-# find /home*/*/{.trash,mail/{*/*/,}.Trash} -depth -mindepth 1 \( \( ! -type d -exec rm -v {} + \) -o \( -exec rmdir -v {} + \) \)+  # find /home*/*/{.trash,mail/{*/*/,}.Trash} -depth -mindepth 1 \( \( ! -type d -exec rm -v {} + \) -o \( -exec rmdir -v {} + \) \)
 </code> </code>
  
-And remember, if you need any help, you can always [[my-knownhost:howto-login|open a Support Ticket]] for assistance.+And remember, if you need any help, you can always 
 +[[my-knownhost:howto-login|open a Support Ticket]] 
 +for assistance.
  
general/disk-space-management.1572901431.txt.gz · Last modified: 2019/11/04 15:03 by dbarber