Save slurm job ID as you submit the job with sbatch

Viewed 418

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

job_id = sbatch --account my_account some_script.sh

echo $job_id

17210254
1 Answers

This can be done with --parsable

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