Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
checkJobState.sh 326 B
#!/bin/bash

# Get the jobID of the caper lead job from the input txt file.
read -ra line <<< "$1"
jobID=${line[3]}

# Query Slurm for the state of the caper lead job.
jobq=$(sacct --format State -j $jobID)

# Return the caper lead job state.
IFS=$'\n' read -rd '' -a jobstate <<< "$jobq"
echo $(echo "${jobstate[2]}" | xargs)