Skip to content

Instantly share code, notes, and snippets.

@smsharma
Created October 15, 2015 15:38
Show Gist options
  • Save smsharma/4bfd36d0fc823f9a8f38 to your computer and use it in GitHub Desktop.
Save smsharma/4bfd36d0fc823f9a8f38 to your computer and use it in GitHub Desktop.
Kill all jobs on a PBS scheduler. Need to specify username in file.
#!/bin/bash
USERNAME=smsharma
#to kill all the jobs
qstat -u$USERNAME | grep "$USERNAME" | cut -d"." -f1 | xargs qdel
#to kill all the running jobs
qstat -u$USERNAME | grep "R" | cut -d"." -f1 | xargs qdel
#to kill all the queued jobs
qstat -u$USERNAME | grep "Q" | cut -d"." -f1 | xargs qdel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment