Lamma
Lamma

Reputation: 1557

Save slurm job ID as you submit the job with sbatch

Is there a way to submit a job to slurm with sbatch and record the job id into a variable?

job_id = sbatch --account my_account some_script.sh

echo $job_id

17210254

Upvotes: 8

Views: 2004

Answers (1)

Lamma
Lamma

Reputation: 1557

This can be done with --parsable

job_id=$(sbatch --parsable test.sh)
echo $job_id
17211434

Upvotes: 11

Related Questions