Skip to content

Instantly share code, notes, and snippets.

@matthewbodaly
Created May 16, 2016 23:27
Show Gist options
  • Save matthewbodaly/2396237ff1ad7325ceff75a558a75918 to your computer and use it in GitHub Desktop.
Save matthewbodaly/2396237ff1ad7325ceff75a558a75918 to your computer and use it in GitHub Desktop.
Python method of getting freespace
#!/usr/bin/python
import os
st = os.statvfs("/")
print "<result>%0.2f</result>" % (st.f_bavail * st.f_frsize / 1000 / 1000 / 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment