From eb03f17c799bbe4648c3137a890e8492b471eab9 Mon Sep 17 00:00:00 2001 From: "C.Peng" <cp1g18@cyan51.cluster.local> Date: Wed, 6 May 2020 12:19:50 +0100 Subject: [PATCH] script --- code | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 code diff --git a/code b/code new file mode 100644 index 0000000..1e6d376 --- /dev/null +++ b/code @@ -0,0 +1,18 @@ +#!/bin/bash +squeue -lu your_username |sed -n '3,$p' > /tmp/temp_cur +job_nums=`cat /tmp/temp_cur|awk '{print $1}'` +printf "%-12s %-8s %-8s %-12s %-9s %-120s\n" "job" "type" "nodes" "Time" "state" "route" +for i in $job_nums; do + scontrol show job $i > /tmp/temp_current + route=`cat /tmp/temp_current|grep -n 'WorkDir='|awk -F '=' '{print $2}'` + QstatA=`cat /tmp/temp_cur|grep $i` + stat=`echo $QstatA|awk '{print $5}'` + nodelist=`echo $QstatA|awk '{print $9}'` + nodes=`echo $QstatA|awk '{print $8}'` + imes=`echo $QstatA|awk '{print $6}'` + Times=`echo $QstatA|awk '{print $7}'` +printf "%-8s %-13s %-3s %-15s %-10s %-120s\n" "$i" "$nodelist" "$nodes" "$imes"/"$Times" "$stat" "$route" + +done +rm /tmp/temp_current +rm /tmp/temp_cur -- GitLab