Skip to content

Commit

Permalink
Fix crontab unspecified USER issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed Dec 7, 2022
1 parent c9d9896 commit 5e1fe4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ush/rocoto_fake_slurm/sacct
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ for pid in ${PIDS}; do
t_start=$t_sub
t_end=$t_sub
name=$pid
user=${USER:-user}

v=$(cat .job_database | grep "pid $pid submitted" | awk '{print $1" "$5}')
if [ ! -z "$v" ]; then
Expand All @@ -27,8 +28,8 @@ for pid in ${PIDS}; do
fi

if [ -z "$v" ]; then
printf "$FMT" $pid ${USER:0:30} ${name:0:30} linux 0.1 $t_sub $t_start $t_end 1 0 RUNNING
printf "$FMT" $pid ${user:0:30} ${name:0:30} linux 0.1 $t_sub $t_start $t_end 1 0 RUNNING
else
printf "$FMT" $pid ${USRE:0:30} ${name:0:30} linux 0.1 $t_sub $t_start $t_end 1 $v COMPLETED
printf "$FMT" $pid ${user:0:30} ${name:0:30} linux 0.1 $t_sub $t_start $t_end 1 $v COMPLETED
fi
done
5 changes: 3 additions & 2 deletions ush/rocoto_fake_slurm/squeue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ for pid in ${PIDS}; do
t_start=$t_sub
t_end=$t_sub
name=$pid
user=${USER:-user}

v=$(cat .job_database | grep "pid $pid submitted" | awk '{print $1" "$5}')
if [ ! -z "$v" ]; then
Expand All @@ -27,8 +28,8 @@ for pid in ${PIDS}; do
fi

if [ -z "$v" ]; then
printf "$FMT" $pid $USER 1 linux $t_sub $t_start $t_end 0.1 0 RUNNING $name
printf "$FMT" $pid $user 1 linux $t_sub $t_start $t_end 0.1 0 RUNNING $name
else
printf "$FMT" $pid $USER 1 linux $t_sub $t_start $t_end 0.1 $v COMPLETED $name
printf "$FMT" $pid $user 1 linux $t_sub $t_start $t_end 0.1 $v COMPLETED $name
fi
done

0 comments on commit 5e1fe4d

Please sign in to comment.