Martini_geek
Martini_geek

Reputation: 719

Python command to check the disk space on UNIX servers

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")

Upvotes: 0

Views: 1947

Answers (1)

juhist
juhist

Reputation: 4314

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")

Upvotes: 1

Related Questions