Skip to content

Commit 6ea0782

Browse files
committed
pbench-move-unpacked: fix error handling
1 parent e323768 commit 6ea0782

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

server/pbench/bin/pbench-move-unpacked

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ function process_tarball {
120120
# remove the symlink from incoming
121121
rm $incoming 2>/dev/null
122122
status=$?
123-
if [[ $status -eq 1 ]] ;then
124-
# $incoming does not exist for some reason - not clear why that would be the case
125-
# but we can go on: no need to abort here.
126-
:
127-
elif [[ $status -ne 0 ]] ;then
123+
if [[ $status -ne 0 ]] ;then
128124
rm $RESULTS/$hostname/$prefix$resultname
129-
ln -s $incoming.copy $RESULTS/$hostname/$prefix$resultname
130-
echo "$TS: Created symlink of $incoming.copy in $RESULTS: code $status" | tee -a $mail_content >&4
125+
if [ -d $incoming.copy ] ;then
126+
ln -s $incoming.copy $RESULTS/$hostname/$prefix$resultname
127+
echo "$TS: Created symlink of $incoming.copy in $RESULTS: code $status" | tee -a $mail_content >&4
128+
else
129+
(echo "$TS: $incoming could not be removed for some reason: code $status";
130+
ls $incoming; echo "----") | tee -a $mail_content >&4
131+
fi
131132
nerrs=$nerrs+1
132133
return 1
133134
fi

0 commit comments

Comments
 (0)