Reputation: 53
Is it possible to use the JobID as an input of the script you are submiting?
I know you can use %j to name the log file with the JobID, but is it possible to do, for example, something similar to
sbatch make-dir.sh %j
where make-dir.sh is
#!/bin/bash
echo $1
As it stands now, it will print %j, but I would like it to print the JobID.
Thanks.
Upvotes: 2
Views: 2495
Reputation: 5357
You should use the environment variable $SLURM_JOBID
in the make-dir.sh
#!/bin/bash
echo $SLURM_JOBID
Upvotes: 5