I have already configured my server to work with user quotas and everything works well. I can modify user quota with the edquota command. How could I do this programmatically, from a bash script for example?


Use setquota.

In the simple form the command is

setquota user blockquota blocklimit inodequota inodelimit filesystem


setquota foo 10G 10G 0 0 /data

to set both the soft quota and hard limit to 10 GB and no inode limit for user foo on /data.

I suppose you could use quota -u $username to get the current quotas, but I'm not sure how easy that is to parse with a script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.