디스크 용량 확인 및 기타 수정

This commit is contained in:
2018-05-04 21:39:32 +09:00
parent 125c201638
commit f32ff66d2f
3 changed files with 18 additions and 5 deletions

9
Crawler/Util.py Normal file
View File

@@ -0,0 +1,9 @@
import subprocess
class Util:
@staticmethod
def get_free_space():
df = subprocess.Popen(["df", "/"], stdout=subprocess.PIPE)
output = df.communicate()[0]
device, size, used, available, percent, mountpoint = str(output).split("\\n")[1].split()
return int(available)