#!/bin/bash # Submit computation job and save the JobId for the dependency JOB_ID_COMPUTE=`sbatch compute.slurm | cut -d " " -f 4` # The data archiving step is only executed if the computation step has run successfully sbatch --dependency=afterok:$JOB_ID_COMPUTE archive_data.slurm