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

fixed quarantine bug & starting to change logging around

parent a240762f
......@@ -18,10 +18,10 @@ 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 /home/eodn/eodn2realearth/src/process-LCzip.sh"
SCRIPT="bash /home/eodn/eodn2realearth/src/process-LCzip.sh &> ${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 /home/eodn/eodn2realearth/src/process-LCtgz.sh"
SCRIPT="bash /home/eodn/eodn2realearth/src/process-LCtgz.sh &> ${LOGS}/process-LCtgz.log"
else # not recognized
echo "SAW (NOT RECOGNIZED): ${filename}"
exit 0
......@@ -30,12 +30,17 @@ fi
# just quarantine everything for now in case we want it later
# (is quarantine the right word anymore? oh well...)
mkdir -p ${QUARANTINE}
mv $filepath ${QUARANTINE}/${filename}
mv -f $filepath ${QUARANTINE}/${filename} # overwrite so we don't crash if reprocessing
# set up processing directory
mkdir -p ${PROCESSING}/${filename}
cd ${PROCESSING}/${filename}
ln $filepath ${filename} # make a hard link so we don't actually duplicate input data; OK as long as processing doesn' tmess w/ it
# 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}
if [ $? -eq 0 ]; then
rm -r ${PROCESSING}/${filename}
else
echo "ERROR [$?] while processing ${PROCESSING}/${filename}"
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