qsub


qsub: get last job id submitted


I use Sun Grid Engine, how I can get the id of the last job submitted with qsub?
currently I use this bash alias
alias lastjob="qstat -u $(whoami) |tail -n1| sed '/LOGIN/d'|cut -d' ' -f1"
Ideally, you should capture the job id from the output of the qsub command:
jobid=$(qsub -terse helloworld.sh)
If you need the last job id later after it is submitted, you can use qstat. It looks like your problem with qstat is caused by "cut" delimiters. The qstat output contains multiple spaces before the job id. Try awk instead.
This works for me:
qstat | tail -n 1 | awk '{print $1}'

Related Links

SLURM how to qsub a task when another task is finished?
Can multiple qsub submissions read the same group of files?
SGE faild to submit job, attribute is not a memory value
How do you submit a job on multiple queues with Torque?
Maui - preventing jobs from running on the same node
qsub: What is the standard when to get occasional updates on a submitted job?
Submitting a job to qsub generates an error, “Warning: no access to tty”
Running samtools from a qsub
How do I schedule a job on multiple nodes with qsub Univa 8.1.7?
How to specify a fixed job name for jobs submitted by qsub
duplicate jobs in sun grid engine
SGE qsub define variable using bach?
Job chaining with qsub
Determine Load Status in qsub
How to avoid this error ?Unable to run job: error: no suitable queues
Silently submit a job with qsub to SGE

Categories

HOME
python
rest
caching
crystal-reports
cil
openssl
json-ld
parse-server
codeeffects
rfc
apple-numbers
devstack
simpy
internet-explorer-11
structuremap
octopus-deploy
ndis
wordpress-theming
symfony-forms
webmethods
future
squarespace
typeahead
rapidjson
linq-to-sql
prediction
azure-servicebus-queues
jquery-waypoints
widevine
frp
edge-detection
reply
mangodb
bxslider
pari
google-drive-realtime-api
body-parser
nsurlconnection
dql
fltk
agent
rule
matlab-cvst
encapsulation
seamless-immutable
udev
addin-express
push-diffusion
audioqueue
freetype2
multilingual-app-toolkit
search-regex
mfc-feature-pack
handlebars.java
acm
android-recyclerview
hateoas
lemoon
hyperthreading
code-readability
registrykey
ipojo
ffprobe
isml
robocode
google-earth-plugin
orientation-changes
candidate-key
qtestlib
scala-2.11
adcolony
formvalidation-plugin
ghostdoc
code-testing
smartystreets
boost-test
colt
korma
level
pic24
crystal-reports-10
db4o
carddav
client-side-scripting
qss
awesomeprint
magickwand
sametime
domain-calculus
moq-3
couchdb-lucene
ninject-extensions
gdt
separation-of-concerns
v4l
posting
paintcomponent
windows-live-id
collect
mvccontrib-grid
msn
task-management
multibyte-functions
callgrind
act
method-signature
evb
castle-validators
standardized
dotproject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App