Commit 3a2e7e2d authored by CEVAER's avatar CEVAER

Added output_path parameter to bash script

parent 751e68ff
#!/bin/bash
while getopts ":d:" o; do
while getopts ":d:o:" o; do
case "${o}" in
d)
shift;
days=$1 ; shift ;;
days=${OPTARG}
;;
o)
output_path=${OPTARG}
;;
* ) echo "unknown opt $1" >&2 ; exit 1 ;;
esac
done
......@@ -21,6 +24,11 @@ if [ -z "$DATABASE_URL" ] ; then
fi
echo "Database URL : $DATABASE_URL"
if [ -z "$output_path" ] ; then
echo "The output path is not defined, define it with -o <output_path>"
exit 1
fi
smap_path=/home/datawork-cersat-public/provider/remss/satellite/l3/smap/smap/wind/v1.0/daily
shopt -s globstar
......@@ -49,4 +57,4 @@ files_to_process=$(echo "$files_to_process" | sed -r '/^\s*$/d')
#printf "%s\n $files_to_process"
# Generating cyclone SMAP files
printf "%s\n $files_to_process" | xargs -r -P 10 -l50 extractSmapCyclone.py --dbd "$DATABASE_URL" -i
printf "%s\n $files_to_process" | xargs -r -P 10 -l50 extractSmapCyclone.py --dbd "$DATABASE_URL" -o "$output_path" -i
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