From a7fc424d590dcc73072ea49e5c6f254258b35a98 Mon Sep 17 00:00:00 2001
From: James Nairn <jwrn3@cam.ac.uk>
Date: Wed, 7 Oct 2020 09:46:07 +0100
Subject: [PATCH] Write log into canto space

Additional additions to .gitignore
---
 .gitignore        | 3 ++-
 weekly_routine.sh | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8ff8656..5746647 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-canto
\ No newline at end of file
+canto
+canto_weekly.log
\ No newline at end of file
diff --git a/weekly_routine.sh b/weekly_routine.sh
index cccacc6..2623a1c 100755
--- a/weekly_routine.sh
+++ b/weekly_routine.sh
@@ -6,7 +6,7 @@
 CANTOSPACE="/data/export/canto-space"
 
 # Define log file
-LOGFILE="/var/log/canto_weekly.log"
+LOGFILE="{$CANTOSPACE}/canto_weekly.log"
 
 # Function to log messages with date stamp
 # e.g. log "Canto script completed successfully"
@@ -178,6 +178,11 @@ if [[ ( -e "${CURATEDPAPERLISTFILE}" ) && ( -s "${CURATEDPAPERLISTFILE}" ) ]]; t
 
 	# remove the fbrf_input_list.tsv file once done, so that the script doesn't try to add the same information again next time its run
 	#/bin/rm "${CURATEDPAPERLISTFILE}"
+
+	# copy ${CURATEDPAPERLISTFILE} into ${CANTOSPACE}
+	log "Copying ${CURATEDPAPERLISTFILE} into ${CANTOSPACE}"
+	cp "${CURATEDPAPERLISTFILE}" "${CANTOSPACE}"
+	
 else
 	log "Not loading ${JSONIMPORTFILE} into Canto. Either ${CURATEDPAPERLISTFILE} does not exist or is empty..."
 fi
@@ -197,4 +202,4 @@ if docker restart "${DOCKERNAME}"; then
 	log "Canto restarted successfully"
 else
 	log "Canto failed to restart sucessfully!"
-fi
+fi
\ No newline at end of file
-- 
GitLab