Notes on how to clean up hard disk space on LinuxWeb/DB server

Source: Internet
Author: User
& Nbsp; the longer the mysqlbinlog date, the more hard disks are occupied. 1. in the mysql command line, type & nbsp; SQL code PURGE & nbsp; MASTER & nbsp; LOGS & nbsp; BEFORE & nbsp; DATE_SUB (& nbsp; NOW (), & nbsp; INTERVAL & nbsp; 10 & nbsp; DAY); & nbsp; & nb Mysql binlog

The longer the date, the more hard disks occupied
1. in the mysql command line

 

SQL code
  1. Purge master logs before DATE_SUB (NOW (), INTERVAL 10 DAY );

Clean logs generated N days ago (change interval n day)


2. modify expire_logs_day in my. cnf.


Web logs
1. periodically split logs
2. expired logs can be deleted.
3. important log backup
Logs can be deleted in the/var/log directory.

Delete unimportant expired websites in the web main directory

If you have developed some small programs, you can check the space occupied by the mysql table.

Useful command lines

Find the file and folder size in the current directory

XML/HTML code
  1. Du-s * | sort-nr | head

Search for files larger than MB

XML/HTML code
  1. Find.-type f-size + 1000000 k

Delete the source code package downloaded during Software Compilation

 

After completing the steps above, my VPS may have cleared up more than 5 GB of hard disk space. Please add.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.