Skip to content

Instantly share code, notes, and snippets.

@almorel
Last active December 18, 2015 10:49
Show Gist options
  • Save almorel/5771742 to your computer and use it in GitHub Desktop.
Save almorel/5771742 to your computer and use it in GitHub Desktop.
Extraction des statistiques d'un serveur TORQUE/MAUI
# Extract des statistiques TORQUE
cat /opt/torque/serv_priv/accounting/2012*|awk -F ';' '{if ($2 ~ '/E'/){print $4}}'|awk '{for (i=1;i<NF;i++){if ($i ~ '/^Exit\|^resources\|^user\|^group\|^Resource\|^queue/'){printf("%s ", $i);}};print ""}'|python -c 'import sys;a=[elt.rstrip().split(" ") for elt in sys.stdin.readlines()]; b=[["".join(subelt.split("=")[1::]) for subelt in elt] for elt in a];c=[";".join(ligne) for ligne in b];print "\n".join(c);'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment