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) ...@@ -18,10 +18,10 @@ filename=$(basename $filepath)
# set $SCRIPT based on input type # set $SCRIPT based on input type
if [ ${filename:0:2} == "LC" ] && [ ${filename: -4} == ".zip" ]; then # landsat zip files if [ ${filename:0:2} == "LC" ] && [ ${filename: -4} == ".zip" ]; then # landsat zip files
echo "SAW LANDSAT ZIP: ${filename}" 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 elif [ ${filename:0:2} == "LC" ] && [ ${filename: -7} == ".tar.gz" ]; then # landsat zip files
echo "SAW LANDSAT TAR.GZ: ${filename}" 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 else # not recognized
echo "SAW (NOT RECOGNIZED): ${filename}" echo "SAW (NOT RECOGNIZED): ${filename}"
exit 0 exit 0
...@@ -30,12 +30,17 @@ fi ...@@ -30,12 +30,17 @@ fi
# just quarantine everything for now in case we want it later # just quarantine everything for now in case we want it later
# (is quarantine the right word anymore? oh well...) # (is quarantine the right word anymore? oh well...)
mkdir -p ${QUARANTINE} 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} mkdir -p ${PROCESSING}/${filename}
cd ${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} $SCRIPT ${filename}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
rm -r ${PROCESSING}/${filename} rm -r ${PROCESSING}/${filename}
else
echo "ERROR [$?] while processing ${PROCESSING}/${filename}"
fi 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