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
E.g.
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.