0

I am writing a script which checks space on UNIX servers. But I am unable to find the right command. I used the following but it gives me same percentage for all paths.

st = os.statvfs("/dev/hd3")

Martini_geek
  • 629
  • 1
  • 5
  • 8
  • possible duplicate http://stackoverflow.com/questions/4260116/find-size-and-free-space-of-the-filesystem-containing-a-given-file – Sajith Silva Mar 24 '15 at 14:38
  • Try search for it. There's plenty of duplicates. http://stackoverflow.com/questions/51658/cross-platform-space-remaining-on-volume-using-python/2372171#2372171 – Roope Mar 24 '15 at 14:38

1 Answers1

1

You give it the mount point, not the device name.

So, instead of e.g.

st = os.statvfs("/dev/hd3")

you do

st = os.statvfs("/boot")
juhist
  • 4,210
  • 16
  • 33