title: How to configure slurm to email out file?
body: <p>I'm a newbie to slurm and I'm trying to configure my bash script to, in the case that a job fails, email the corresponding standard output file when notifying me. I've managed to configure email notifications, but how can I make the body of the email contain standard output? </p>
  
  <pre><code>#!/bin/bash
  #SBATCH -n 2                    # two cores
  #SBATCH --mem=3G
  #SBATCH --time=48:00:00         # total run time limit (HH:MM:SS)
  #SBATCH --mail-user=rylansch
  #SBATCH --mail-type=FAIL
  
  export PYTHONPATH=.
  python -u model_train.py        # -u flushes output buffer immediately
  
  </code></pre>
  
  <p>I don't see answers <a href="https://stackoverflow.com/questions/53003230/how-to-configure-the-content-of-slurm-notification-emails">How to configure the content of slurm notification emails?</a> or <a href="https://stackoverflow.com/questions/32109171/how-to-let-sbatch-send-stdout-via-email">How to let SBATCH send stdout via email?</a></p>