Commit c1f37542 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Retry the imkdir command

On failure, register the error and continue
parent dffaeeba
...@@ -50,11 +50,13 @@ irods_push(){ ...@@ -50,11 +50,13 @@ irods_push(){
SIZE=$(stat -c %s $RESIFDD_WORKDIR/$KEY.tar) SIZE=$(stat -c %s $RESIFDD_WORKDIR/$KEY.tar)
SIZEMB=$(($SIZE/1024/1024)) SIZEMB=$(($SIZE/1024/1024))
echo "[$KEY] Sending data to iRODS ($SIZEMB MB)" echo "[$KEY] Sending data to iRODS ($SIZEMB MB)"
imkdir -p $KEY
if [[ $? -ne 0 ]]; then for n in $(seq 1 5); do [ $n -gt 1 ] && sleep 10 ; imkdir -p $KEY && s=0 && break || s=$?; done
if [[ $s -ne 0 ]]; then
echo "[$KEY] Error 002 creating remote directory. Manual action has to be taken." echo "[$KEY] Error 002 creating remote directory. Manual action has to be taken."
format_report $KEY $SIZEMB $(date +%Y-%m-%dT%H:%M:%S) - - 'Error 010. imkdir failed' >> $LOCAL_REPORT
zabbix_err "${KEY}:Error 002" zabbix_err "${KEY}:Error 002"
exit 1 return 1
fi fi
COMMAND="iput --retries 5 -T -K -f -X $RESIFDD_WORKDIR/${KEY}.restart $RESIFDD_WORKDIR/${KEY}.tar $KEY/staging.tar" COMMAND="iput --retries 5 -T -K -f -X $RESIFDD_WORKDIR/${KEY}.restart $RESIFDD_WORKDIR/${KEY}.tar $KEY/staging.tar"
...@@ -247,7 +249,7 @@ for dir in $(find . -maxdepth 3 -type d | sort); do ...@@ -247,7 +249,7 @@ for dir in $(find . -maxdepth 3 -type d | sort); do
# Test if in recovery mode, we should send or not # Test if in recovery mode, we should send or not
if [[ -r $RECOVERY_FILE ]]; then if [[ -r $RECOVERY_FILE ]]; then
if egrep -q -e ".*$YEAR.*$NETWORK.*$STATION.*( OK | Skipped ).*" $RECOVERY_FILE; then if egrep -q -e ".*$YEAR.*$NETWORK.*$STATION.*( OK | Skipped ).*" $RECOVERY_FILE; then
echo "Found OK or skipped in $RECOVERY_FILE for $KEY. Skipping" echo "[$KEY] Found OK or skipped in ${RECOVERY_FILE}. Skipping"
format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT format_report $KEY "-" $(date +%Y-%m-%dT%H:%M:%S --date=@$start) "-" "-" "Skipped" >> $LOCAL_REPORT
continue continue
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment