EC Server=how to clear diskspace amazon ec2 server

July 14, 2021 . 1 MIN READ

how to clear diskspace amazon ec2 server

https://stackoverflow.com/questions/20031604/amazon-ec2-disk-full

 

up vote40down voteaccepted Well, I think its one (or more) logfiles which have grown too large and need to be removed/backupped. I would suggest going after the big files first. So find all files greater than 10 MB (10 MB is a big enough file size, you can choose +1M for 1MB similarly)

sudo find / -type f -size +10M -exec ls -lh {} \;

and now you can identify which ones are causing the trouble and deal with them accordingly.

As for your original du -a / | sort -n -r | head -n 10 command, that won’t work since it is sorting by size, and so, all ancestor directories of a large file will go up the pyramid, while the individual file will most probably be missed.

https://stackoverflow.com/questions/20031604/amazon-ec2-disk-full

Leave a Reply

Your email address will not be published. Required fields are marked *