Commit ee0cc254 authored by Nick Bearson's avatar Nick Bearson
Browse files

removing a bug that put the log before the file -_-

parent 9b40d473
......@@ -18,10 +18,12 @@ filename=$(basename $filepath)
# set $SCRIPT based on input type
if [ ${filename:0:2} == "LC" ] && [ ${filename: -4} == ".zip" ]; then # landsat zip files
echo "SAW LANDSAT ZIP: ${filename}"
SCRIPT="bash ${SRC}/process-LCzip.sh &> ${LOGS}/process-LCzip.log"
SCRIPT="${SRC}/process-LCzip.sh"
LOG_TO="${LOGS}/process-LCzip.log"
elif [ ${filename:0:2} == "LC" ] && [ ${filename: -7} == ".tar.gz" ]; then # landsat zip files
echo "SAW LANDSAT TAR.GZ: ${filename}"
SCRIPT="bash ${SRC}/process-LCtgz.sh &> ${LOGS}/process-LCtgz.log"
SCRIPT="${SRC}/process-LCtgz.sh"
LOG_TO="${LOGS}/process-LCtgz.log"
else # not recognized
echo "SAW (NOT RECOGNIZED): ${filename}"
exit 0
......@@ -38,9 +40,9 @@ cd ${PROCESSING}/${filename}
# link input file in and go
ln ${QUARANTINE}/${filename} ${filename} # make a hard link so we don't actually duplicate input data; OK as long as processing doesn' tmess w/ it
$SCRIPT ${filename}
$SCRIPT ${filename} &> ${LOG_TO}
if [ $? -eq 0 ]; then
rm -r ${PROCESSING}/${filename}
else
echo "ERROR [$?] while processing ${PROCESSING}/${filename}"
echo "ERROR [$?] while processing ${PROCESSING}/${filename}" # we shouldn't hit this due to `set -e`
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