title: SLURM: Save job script
body: <p>In SLURM, I can easily specify the files for logging in my job script:</p>
  
  <pre><code>#SBATCH --output=logs/output-%j
  #SBATCH --error=logs/error-%j
  </code></pre>
  
  <p>Now, I use a jobscript that is generated programmatically. Whenever I submit a job, I'd like to save that jobscript as <code>logs/jobscript-%j</code>.</p>
  
  <p><strong>How could I do that?</strong> (The main difficulty seems to be to get <code>%j</code>.)</p>