Add option to suppress storage copy for testing

This commit is contained in:
2016-05-04 10:47:04 -04:00
parent 790930dd66
commit e9a9ae186c
5 changed files with 26 additions and 4 deletions
+9 -1
View File
@@ -8,6 +8,7 @@ where:
-d working directory name
-p photosynthetic type
-s start job
-t suppress storage copy
-c cleanup directory
-k kill job"
@@ -27,7 +28,7 @@ launcher="$base_directory/piscal_launcher.sh"
# http://stackoverflow.com/a/14203146/99492
# http://wiki.bash-hackers.org/howto/getopts_tutorial
while getopts "hd:f:p:sck" opt; do
while getopts "hd:f:p:stck" opt; do
#echo "$opt = $OPTARG"
case "$opt" in
h )
@@ -43,6 +44,9 @@ while getopts "hd:f:p:sck" opt; do
s )
task="launch"
;;
t )
suppress_storage_copy=true
;;
c )
task="cleanup"
;;
@@ -75,6 +79,7 @@ pid_path="$working_directory/$pid_filename"
## Process task
if [ "$task" = "launch" ]; then
# TODO: verify process isn't running yet
piscal_config_file="$working_directory"/piscal.cfg
# write config file for piscal
echo $photosynthetic_type > "$piscal_config_file"
@@ -83,6 +88,9 @@ if [ "$task" = "launch" ]; then
>> "$piscal_config_file"
command="$launcher -d $working_directory -f piscal.cfg"
if [ "$suppress_storage_copy" = true ]; then
command="$command -t"
fi
# launch it, sending error output to file
nohup ${command} > $working_directory/$stderr_filename 2>&1 &