有什么办法通过脚本自动化用户的主文件夹qouta。 我有自动useradd脚本,我想在脚本中添加大小为2 GB的主文件夹的配额代码。 例如:
edquota sally Disk quotas for user sally (uid 1045): Filesystem blocks soft hard inodes soft hard /dev/loop0 16 0 0 4 0 0
如何使命令edqouta通过脚本将硬限制的值从0更改为2037760? 换句话说,如何修改edquota sally来自动更改值。
好吧,你看起来像你做男人edquota 🙂
它看起来像所有你需要做的是附加一些文本到配额文件:即
echo 'text' >> /quota.user
例如在OpenBSD中,你可以使用:
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
edquota是不是真的适合脚本。
quotatool从命令行处理配额。 易于在脚本中使用。 它包含在大多数主要的Linux发行版中,也可用于* BSD,Mac OSX,AIX和Solaris。