Get more informative slurm email notification

Here is an example (Note: '-n 1' is needed for srun command. It make sure only run one copy of the commands.):

Create a file myJob.sh with ( you can replace "echo firstCommand; echo secondCommand' with your own commands):

#!/bin/bash srun -n 1 -t $SRUNTIME --mem $SRUNMEM bash -c "{ echo I am running on:; hostname; echo firstCommand; echo secondCommand; } && touch myJob.success" sleep 5 # wait slurm get the job status into its database echo Job done. Summary: sacct --format=JobID,Submit,Start,End,State,Partition,ReqTRES%30,CPUTime,MaxRSS,NodeList%30 --units=M -j $SLURM_JOBID sh sendJobFinishEmail.sh myJob [ -f myJob.success ] && exit 0 || exit 1

Create a file sendJobFinishEmail.sh