2013-10-13 72 views
-2

我只有這個服務器上的小php文件,它適合80GB。所有的空間在哪裏消耗?如果它永遠不會清除臨時空間,它是不可持續的。我怎麼能解決這個問題,並清除可能會佔用服務器上所有空間的東西。它可能是日誌?Linux存儲大小已滿..但如何...?

Filesystem   Size Used Avail Use% Mounted on 

/dev/xvda1    79G 79G 4.6M 100%/

tmpfs     1.9G  0 1.9G 0% /dev/shm 

這說明所有的大小是在無功消耗/日誌/的httpd〜

du -a/| sort -n -r | head -n 10 
du: cannot access `/proc/1635/task/1635/fd/4': No such file or directory 
du: cannot access `/proc/1635/task/1635/fdinfo/4': No such file or directory 
du: cannot access `/proc/1635/fd/4': No such file or directory 
du: cannot access `/proc/1635/fdinfo/4': No such file or directory 
82313432  /
81281820  /var 
80612296  /var/log 
80568212  /var/log/httpd 
73591608  /var/log/httpd/access_log 
6949756 /var/log/httpd/access_log-20130818 
784468 /usr 
428232 /var/spool 
428188 /var/spool/mail 
428184 /var/spool/mail/root 

如何清除了這一點,防止它在未來發生?

+1

最大的文件夾,你應該問的服務器故障這一問題,而不是堆棧Overfow 。你想檢查/ var/log,當你突然用完空間時,這是一個常見的嫌疑犯。 – kamituel

+0

感謝Kamituel。它看起來就像是日誌。 – timothymarois

+0

是的,我想。請注意,日誌通常不會很快增長 - 如果是httpd,請在刪除它們之前查看此日誌,以查看Apache的問題。否則,你會再次用完空間。 – kamituel

回答

0

先嚐試清理一些空間,例如截斷在/ var一些日誌文件/日誌 和檢查後,它們是由du -a/| sort -n -r | head -n 10

+0

它看起來像所有的空間是在var/log/httpd〜with access_log- 什麼是清除該問題的最佳方法,然後防止將來發生這種情況? – timothymarois

+0

有很多access_logs文件或只有一個大?如果它只是一個,你可以截斷它回聲''>/var/log/http/large_access_log,如果有太多的文件,你必須改變日誌旋轉選項...什麼是你的操作系統? –

+0

弗拉基米爾,其6949756的/ var /日誌/ httpd的/訪問日誌-20130818(其I 'RM',除去),然後有 73591608 /無功/日誌/ httpd的/訪問日誌 – timothymarois