Defaultni quoty u uzivatelu
David Rohleder
davro na ics.muni.cz
Pátek Srpen 6 14:38:52 CEST 1999
Petr.Novotny na antek.cz (Petr Novotny) writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > Ano, je to brute force, ale taky nejjednodussi... A tech par vyjimek ze
> > 100 (nebo i z vice...), to uz doresim ruco... Navic: na neexistujici
> > uzivatele to akorat zahlasi chybu (httpd, alespon obvykle) a zbude mi
> > ftp-cko. Nic jineho me nenapada...
>
> Tohle pise Quota mini-HOWTO:
>
>
>
> _Assigning quota for a bunch of users with the same value_
>
> To rapidly set quotas for, say 100 users, on my system to the same
> value as my user _bob_, I would first edit _bob_'s quota information
> by hand, then execute:
>
>
> edquota -p bob `awk -F: '$3 > 499 {print $1}' /etc/passwd`
>
>
>
> assuming that you are using csh, and that you assign your user UID's
> starting with 500.
>
> Funguje to i pod bash, a UID startuji od 500 na RedHatu taky...
> Lze samozrejme dale modifikovat.
Jen at nenarazite na omezeni delky radku v shellu. :)
IFS=":"
while read name passwd uid ; do
if [ $uid -gt 499 ] ; then
edquota -p bob $name
fi
done </etc/passwd
--
-------------------------------------------------------------------------
David Rohleder davro na ics.muni.cz
Institute of Computer Science, Masaryk University
Brno, Czech Republic
-------------------------------------------------------------------------
Další informace o konferenci Linux