Cause
Today, the point code is submitted locally, but to the server git pull when prompted No spaceleft on the device, the first reaction is the suspect may be full (probably log caused), but think it is not likely to think, Only one application is deployed on this server, and it is not a small amount of space to see the project footprint.
Resolution process
1, as a Linux rookie, the first time Baidu to check the use of hard disk commands
[Email protected] ~]# df-h
File system capacity has been used with available% mount points
/DEV/HDA1 20G 2.4G 18G 13%/
Tmpfs 1006M 0 1006M 0%/dev/shm
The above-mentioned content is resolved, because the terminal is closed, so the phenomenon before the resolution is reproduced, is basically only show the second line of content, resolved before the line is not underlined. I was thinking about WTF.
2, then continue to check orders, inadvertently see df/home This command, with the
[Email protected] ~]# Df/home
File system 1k-block already used% mount point available
/DEV/HDA1 20802016 20798393 3623 100%/
Assi Bar, finally found this goods, as expected occupancy rate reached 100%, but I still do not know what the specific documents caused, so look for the company's ops brother looked under
3, the operation of the elder brother, not the same extraordinary, once found the black sheep
[Email protected] ~]# Ll-ah
-rw-r--r--1 root root 20G 06-08 10:38 test.log
Ouch, this what ghost accounted for 20G, open found inside Baidu's HTML code, is the crawler to hit the log
4. See who is writing the file
[Email protected] ~]# lsof Test.log
This command can only be displayed when the file is written, finally although the process number is obtained, but because the process is closed, so still can't find
5, suddenly I flashed a flash, vaguely remember to write a test of their own crontab timed script
[Email protected] ~]# crontab-L/1 * * * */usr/bin/curl http://www.baidu.com >>/R Oot/test.log 2>&1
Sure enough it is it, is it, it is it, that is it ~
6, delete the Test.log file, and stop the script problem solved
PS: After the problem solved, ops brother also used Netstat-utlpn|grep 2 command to sweep the server open port, suggest to change these default, because there are many hackers will scan these ports, there are security problems
Summarize
This time the main is the Black Dragon incident, after the test did not stop the timed script in time, resulting in printing log full disk.
Linux Server Report no space left on device error resolution process record