I'm not too great at scripting yet, i've written a couple of basic scripts hacked together from others i've seen working and ideas i've picked up here and there...but anyways....
I need to be able to check disk quota and determine how much free space i have. My other scripts always used df but on the system i'm on now i need to make them work with quota.
anyways, i figured out that a user can call quota and get a reading like this:
what's the best way to figure out the free space....i know it would be to somehow take the usage number and subtract it from the limit number but i do not know the best way to do this..
i know i can use tail -1 to get it down to just
but what i do from there....
edit, i just figured out awk is what i'm looking for.
I need to be able to check disk quota and determine how much free space i have. My other scripts always used df but on the system i'm on now i need to make them work with quota.
anyways, i figured out that a user can call quota and get a reading like this:
Code:
Disk quotas for user rpuser11 (uid 1004):
Filesystem usage quota limit grace files quota limit grace
/home 30 0 78643200 15 0 0
what's the best way to figure out the free space....i know it would be to somehow take the usage number and subtract it from the limit number but i do not know the best way to do this..
i know i can use tail -1 to get it down to just
Code:
/home 30 0 78643200 15 0 0
edit, i just figured out awk is what i'm looking for.