imports de petits utilisatires pour faire des stats et voir les tats de
certains trucs darcs-hash:20050411210725-4ec08-0edcb7b1d4e46ce310dbffcffd8b07e50690c8a1.gz
This commit is contained in:
parent
21f285fabb
commit
477219f2ed
8 changed files with 260 additions and 0 deletions
22
gestion/tools/list_quotas.py
Executable file
22
gestion/tools/list_quotas.py
Executable file
|
@ -0,0 +1,22 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
|
||||
import sys
|
||||
from commands import getoutput
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
|
||||
from ldap_crans import crans_ldap, decode
|
||||
|
||||
db = crans_ldap()
|
||||
comptes = db.search('aid=*')['adherent'] + db.search('cid=*')['club']
|
||||
|
||||
txts = []
|
||||
|
||||
for c in comptes :
|
||||
if not c.compte() :
|
||||
continue
|
||||
quota = getoutput('quota %s | grep "/dev/" | awk \'{ print $1" "$3" "$4 }\'' % c.compte() )
|
||||
if quota != '/dev/sdb1 300000 500000\n/dev/sdb2 50000 75000' :
|
||||
txts.append( '%s (%s)\n%s' % (c.Nom(), c.compte(), quota) )
|
||||
|
||||
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts).encode('iso-8859-1')
|
Loading…
Add table
Add a link
Reference in a new issue