Skip to content

Instantly share code, notes, and snippets.

@ruledio
ruledio / app-size.py
Created Jan 4, 2019
Cloudways Disk Space Details/Quota Per Application
View app-size.py
import subprocess
proc = subprocess.Popen("du -sh ./applications/* | sort -hr", shell=True, stdout=subprocess.PIPE)
for line in iter(proc.stdout.readline,''):
line = line.split()
size = line[0]
app_dir = line[1]
app_name = app_dir[15:]
app_conf = "/home/master/applications/%s/conf/server.apache" % (app_name)