Created
April 23, 2015 22:01
-
-
Save noisychannel/de2883a5d9cfca021de9 to your computer and use it in GitHub Desktop.
Monitor qsub jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
username="gkumar" | |
while true | |
do | |
clear | |
printf '%99s\n' | tr ' ' - | |
echo "My Jobs" | |
printf '%99s\n' | tr ' ' - | |
printf "Number of jobs currently running : `qstat | grep $username | awk '{if (\$5 == \"r\") {print \$_;}}' | wc -l` \n\n" | |
printf "Jobs running:\n" | |
printf "`qstat | grep $username | awk '{if (\$5 == \"r\") {print \$_;}}' | awk '{print $1, $3}' | sort | uniq -c `" | |
printf "\n\n" | |
printf "Machines on which jobs are running: \n" | |
printf "`qstat | grep $username | awk '{if (\$5 == \"r\") {print \$_;}}' | awk '{print $8}' | sort | uniq -c`" | |
printf "\n" | |
printf '%99s\n' | tr ' ' - | |
printf "Queue Information \n" | |
printf '%99s\n' | tr ' ' - | |
printf "Current Users :\n`q.who`" | |
printf "\n\n" | |
printf '%99s\n' | tr ' ' - | |
printf "Log information \n" | |
printf '%99s\n' | tr ' ' - | |
i=1 | |
for var in "$@" | |
do | |
printf "Log $i :\n" | |
printf "`tail $var`" | |
printf "\n\n" | |
done | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment