Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
pegasus-isi
ACME-Workflow
Commits
7ccf886f
Commit
7ccf886f
authored
Jan 26, 2015
by
Juve, Gideon
Browse files
Add error checking to acme.sh
parent
63379819
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/acme.sh
View file @
7ccf886f
#!/bin/bash
set
-e
function
usage
()
{
echo
"Usage:
$0
-stop STOP_OPTION -n STOP_N -run RUN"
echo
"Usage:
$0
[-continue] -stage N
-stop STOP_OPTION -n STOP_N -run RUN"
}
if
[
"$#"
==
"0"
]
;
then
...
...
@@ -9,11 +11,14 @@ if [ "$#" == "0" ]; then
exit
1
fi
CONTINUE_RUN
=
FALSE
while
[
"$#"
-ne
0
]
;
do
case
"
$1
"
in
-case
)
shift
CASE
=
$1
-continue
)
CONTINUE_RUN
=
TRUE
;;
-stage
)
STAGE
=
$1
;;
-stop
)
shift
...
...
@@ -23,10 +28,6 @@ while [ "$#" -ne 0 ]; do
shift
STOP_N
=
$1
;;
-run
)
shift
RUN
=
$1
;;
*
)
usage
exit
1
...
...
@@ -35,21 +36,48 @@ while [ "$#" -ne 0 ]; do
shift
done
echo
RUN
$RUN
echo
STOP_N
$STOP_N
echo
STOP_OPTION
$STOP_OPTION
echo
CONTINUE_RUN
$CONTINUE_RUN
echo
STAGE
$STAGE
exit
0
if
[
-z
"
$STAGE
"
]
;
then
echo
"ERROR: Specify -stage"
usage
exit
1
fi
cd
$PBS_O_WORKDIR
if
[
-z
"
$STOP_N
"
]
;
then
echo
"ERROR: Specify -n"
usage
exit
1
fi
CASE
=
$(
./xmlquery CASE
-valonly
-silent
)
if
[
-z
"
$STOP_OPTION
"
]
;
then
echo
"ERROR: Specify -stop"
usage
exit
1
fi
./xmlchange
-file
env_run.xml
-id
RUNDIR
-val
$PWD
/
$RUN
./xmlchange
-file
env_run.xml
-id
STOP_N
-val
$STOP_N
./xmlchange
-file
env_run.xml
-id
STOP_OPTION
-val
$STOP_OPTION
if
!
[
-z
"
$PBS_O_WORKDIR
"
]
;
then
cd
$PBS_O_WORKDIR
fi
# We never want to resubmit the jobs in the Pegasus workflow
./xmlchange
-file
env_run.xml
-id
RESUBMIT
-val
0
./xmlchange
-file
env_run.xml
-id
DOUT_S_ROOT
-val
\$
CASEROOT/archive
# Only continue for stage > 1
./xmlchange
-file
env_run.xml
-id
CONTINUE_RUN
-val
$CONTINUE_RUN
# Set the interval
./xmlchange
-file
env_run.xml
-id
STOP_OPTION
-val
$STOP_OPTION
./xmlchange
-file
env_run.xml
-id
STOP_N
-val
$STOP_N
# We might need to change these
#./xmlchange -file env_run.xml -id RUNDIR -val $PWD/$RUN
#./xmlchange -file env_run.xml -id DOUT_S_ROOT -val \$CASEROOT/archive
# Get the case name and invoke the script
CASE
=
$(
./xmlquery CASE
-valonly
-silent
)
exec
$CASE
.run
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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