From 668cd2e395254359f511a4ea72ab8a64d7516198 Mon Sep 17 00:00:00 2001
From: davidh-ssec <david.hoese@ssec.wisc.edu>
Date: Thu, 4 Jan 2018 14:39:41 -0600
Subject: [PATCH] Fix log and lock directory names in new environment

---
 scripts/archive_tower.sh    | 2 +-
 scripts/loggernet_rotate.sh | 2 ++
 scripts/metobs_config.sh    | 4 +++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/archive_tower.sh b/scripts/archive_tower.sh
index d14f386..52cbca4 100755
--- a/scripts/archive_tower.sh
+++ b/scripts/archive_tower.sh
@@ -12,7 +12,7 @@ DATE=$1
 if [ -z "$DATE" ]; then
    DATE=`date +%Y%m%d`
 fi
-LOCK="${ENV}/locks/${SCRIPT_NAME}.lock"
+LOCK="${LOCKDIR}/${SCRIPT_NAME}.lock"
 logfile="${LOGDIR}/${SCRIPT_NAME}.log"
 
 if [ ! -d $LOGDIR ]; then
diff --git a/scripts/loggernet_rotate.sh b/scripts/loggernet_rotate.sh
index e3458fa..3b1fd2e 100755
--- a/scripts/loggernet_rotate.sh
+++ b/scripts/loggernet_rotate.sh
@@ -114,6 +114,8 @@ for file_suffix in $FILE_SUFFIXES; do
         cp $header_fn $input_file
     else
         # loggernet doesn't like empty destination files
+        # this could have been from a permissions issue during testing
+        # but I'm not going to change it now that it is working
         rm $input_file
     fi
 
diff --git a/scripts/metobs_config.sh b/scripts/metobs_config.sh
index c612e1a..552801e 100644
--- a/scripts/metobs_config.sh
+++ b/scripts/metobs_config.sh
@@ -11,7 +11,9 @@ export TOWER_CACHE_DIR="${DATA_ROOT}/cache/aoss/tower"
 # Python environment to use and where scripts are location
 export ENV=/opt/metobs/aoss_tower
 # Directory where logs will be stored
-export LOGDIR=$ENV/logs
+export LOGDIR=$ENV/log
+# Directory where lock files will be stored
+export LOCKDIR=$ENV/lock
 # Directory where work files can be placed (inside a separate temp directory)
 export WORKDIR="${DATA_ROOT}/tmp"
 
-- 
GitLab