Skip to content

Instantly share code, notes, and snippets.

View ryjmacdonell's full-sized avatar

Ryan MacDonell ryjmacdonell

View GitHub Profile
@ryjmacdonell
ryjmacdonell / rqstat
Last active December 1, 2016 19:25
User specific qstat with job counting and tracking
#!/bin/bash
allj=$(qstat -a)
echo "($(date +"%Y-%m-%d %H:%M:%S"))"
echo "saturn: Running $(echo "$allj" | awk '{print $10}' | grep R |wc -l) of $(($(echo "$allj" | wc -l)-5)) jobs"
myj=$(echo "$allj" | grep $USER)
if [ -z "$myj" ]; then
echo "$USER: Running 0 of 0 jobs"
echo "" >& /home/$USER/.runqueue.tmp
else