scripts/gestion/tools/list_quotas.py
bernat f80332ce60 Modif de Bilou qui commite pas
darcs-hash:20050916074842-d1718-fac70baa51cd4acea4b4b33019964ab5f078ab3b.gz
2005-09-16 09:48:42 +02:00

22 lines
733 B
Python
Executable file

#! /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/sda1 400000 600000\n/dev/sda2 102400 153600' and quota != '/dev/sda2 102400 153600\n/dev/sda1 400000 600000' :
txts.append( '%s (%s)\n%s' % (c.Nom(), c.compte(), quota) )
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts).encode('iso-8859-1')