1

Is there any way to automate user's home folder qouta by script. I have auto useradd script, and I want to add code in script about quota for home folder of size 2 GB. For example:

edquota sally Disk quotas for user sally (uid 1045): Filesystem blocks soft hard inodes soft hard /dev/loop0 16 0 0 4 0 0 

How to make command edqouta change value of hard limit from 0 to 2037760 by script? in other words how to modify edquota sally to automatically change value.

2 Answers 2

2

edquota is not really suitable for scripting.

quotatool handles quotas from the commandline. Easy to use in scripts. It's included in most major Linux distributions, and is also available for *BSD, Mac OSX, AIX and Solaris.

2
  • 1
    Looks like quotatool does not work with user-ids that do not exist, right? Commented Nov 19, 2015 at 3:48
  • 1
    Oh, it does. You have to prepend : (colon) before the user ID Commented Nov 19, 2015 at 3:51
1

OK, it looks like you did man edquota :-)

It looks like all you need to do is append some text into the quota files: i.e.

echo 'text' >> /quota.user 

For example in OpenBSD, you would use:

FILES quota.user at the filesystem root with user quotas quota.group at the filesystem root with group quotas /etc/fstab to find filesystem names and locations 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.