The/var mounted by/dev/XXX on the server is almost over 90%, so you need to clear the log file.
DF-H
...
/Dev/xxx xxG 1.0g 93%/var
...
Check the file in/var/log
CD/var/log
Ls
...
-RW -------. 1 Root 26G October 20 15:18 XXXX. Log
...
That is, xxxx. the log file occupies a lot of disk space. After reading the content, we found that it was a SYSLOG log file. It was saved for several months, so we deleted it.
Rm XXXX. Log
Then DF-H
...
/Dev/xxx xxG 1.0g 93%/var
...
The disk space is not released. Some programs are still operating on this file, and the pointer is not released.
Lsof | grep deleted | grep XXXX. Log
Rsyslogd XXX1 root XW Reg 8, 2 xxxxxxx xxxx/var/log/xxxx. Log (Deleted)
The SYSLOG program is still operating on this file.
So I used the process number of this program: XXX1 kill it.
Kill-9 XXX1
After completion, we found that rsyslog was not started.
Restart only
/Etc/init. d/rsyslog restart
Disable the system logger: [failed]
Start the system logger: [OK]
Check the disk space and find that the space has been released.
After that, Google clears the file before deleting the file, which can quickly release the disk space.
Echo ""> XXX. Log
Rm-rf xxx. Log
This method will be retried next time
Record the deletion of large files at a time, but the disk does not release space