# After the job is done we copy our output back to $SLURM_SUBMIT_DIR rsync -azWHAXS4 ${SCRATCH_DIRECTORY}/* ${SLURM_SUBMIT_DIR}/ # After everything is saved to the home directory, delete the work directory to save space on /scratch/workdir cd ${SLURM_SUBMIT_DIR} && rm -rf ${SCRATCH_DIRECTORY} echo "end of ${SLURM_JOB_NAME}"