Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
datadump
Commits
c1f37542
Commit
c1f37542
authored
Jul 18, 2019
by
Jonathan Schaeffer
Browse files
Retry the imkdir command
On failure, register the error and continue
parent
dffaeeba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/resifdatadump
View file @
c1f37542
...
...
@@ -50,11 +50,13 @@ irods_push(){
SIZE
=
$(
stat
-c
%s
$RESIFDD_WORKDIR
/
$KEY
.tar
)
SIZEMB
=
$((
$SIZE
/
1024
/
1024
))
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."
format_report
$KEY
$SIZEMB
$(
date
+%Y-%m-%dT%H:%M:%S
)
- -
'Error 010. imkdir failed'
>>
$LOCAL_REPORT
zabbix_err
"
${
KEY
}
:Error 002"
exit
1
return
1
fi
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
# Test if in recovery mode, we should send or not
if
[[
-r
$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
continue
fi
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment