modern-web-design-and-development

(Brent) #1

If any of them show 100% usage, then the command probably took eons to
type, and you will need to free up some space fast.


Quick Fix


You should still be able to FTP to the server and remove massive files that
way. A good place to start is the log files and any back-up directories you
have.


Yo u c o u l d a l s o t r y r u n n i n g t h e find command to search for and remove
huge files. This command finds files bigger than 10 MB and lets you scroll
through the results one page at a time. You might need to run it as root to
avoid a lot of permission denied messages (see below for how to do
this). It might also take a long time to run.


root@server# find / -size +10000000c | more

You could also restrict the search to the full partition or to just your
websites, if you know where they are:


root@server# find /var/www/vhosts/ -size +10000000c | more

If you want to know just how big those files are, you can add a formatting
sequence to the command:


root@server# find /var/www/vhosts -size +10000000c -printf
"%15s %p\n"

When you’ve found an unnecessarily big file, you can remove it with rm:


root@server# rm /var/www/vhosts/badwebsite.com/backups/really-
big-and-old-backup-file.tgz
Free download pdf