& 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
- 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
- Du-s * | sort-nr | head
Search for files larger than MB
XML/HTML code
- 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.