How to use a variable with SLURM sbatch to set the output/error file name?
0
votes
2
answers
4546
views
We've just switched to using SLURM and I would like to submit a series of jobs using a loop and
sbatch
. Previously, I could use a variable as part of the output file names. I've been trying to do this in sbatch
using --export
to pass in the variable but can't get the variable to be interpolated for the std error/output file names. I think it's working for the job name (-J
) and --wrap
parts though.
for i in *fastq.gz; do sbatch \
--export=i=$i --error='$i.eo%j' --output='$i.eo%j' \
-J trim_basename ${i}
\
--wrap="fastq_trim_single.sh ${i}" \
; done
Produces output files with $i in the name: $i.eo68065. Is it possible to do what I want to do?
Note: ideally, I would like to use basename $i
rather than $i
for the output file name.
Asked by kanne
(1 rep)
Mar 1, 2018, 01:14 AM
Last activity: May 17, 2025, 02:05 PM
Last activity: May 17, 2025, 02:05 PM