FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 042f3241 authored by Vitor Trovisco's avatar Vitor Trovisco
Browse files

Revert "weekly_export.sh - testing parallel copying the export json file to a...

Revert "weekly_export.sh - testing parallel copying the export json file to a couple of different folders"

This reverts commit ddc87ef8
parent 83e96361
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
# This script exports data from canto - to be set to run automatically on Wednesdays noon.
# Define canto-space root in flybase-vm
# Define canto-space root
CANTOSPACE="/data/export/canto-space"
# Define logs folder inside canto-space
......@@ -11,12 +11,14 @@ LOGS="logs"
# Define log file
LOGFILE="${CANTOSPACE}/${LOGS}/canto_weekly_export.log"
# Define path to staging folder in flybase-vm
STAGING_CANTOEXPORT="/data/export/staging/canto_export_json"
# Redirect all output to logfile
exec &>> "${LOGFILE}"
# Create archive directory if required
EXPORT_DIR="${CANTOSPACE}/import_export"
EXPORT_FILENAME=canto_server_export_latest.json
# Function to log messages with date stamp
# e.g. log "Canto script completed successfully" generates something like 2020-05-20 10:24:37: Canto script completed successfully
......@@ -25,7 +27,7 @@ function log () {
/bin/echo "${DATESTAMP}: ${1}"
}
# Define export directory filepath
# Create archive directory if required
EXPORT_DIR="${CANTOSPACE}/import_export"
EXPORT_FILENAME=canto_server_export_latest.json
......@@ -48,15 +50,10 @@ if ./canto/script/canto_docker --non-interactive ./script/canto_export.pl canto
EXPORT_FILENAME_ARCHIVE="canto_server_export_$(date +"%Y-%m-%d-%T").json"
## Copying canto_server_export_latest.json to local canto-space archive and flybase-vm staging folder
#log "Archiving ${EXPORT_FILENAME} to ${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE} and ${STAGING_CANTOEXPORT}/${EXPORT_FILENAME_ARCHIVE}"
#parallel cp -v "${EXPORT_DIR}/${EXPORT_FILENAME}" ::: "${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE}" "${STAGING_CANTOEXPORT}/${EXPORT_FILENAME_ARCHIVE}"
# Test parallel copying of canto_server_export_latest.json to local canto-space archive and (for testing purposes) to the origin folder
log "Archiving ${EXPORT_FILENAME} to ${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE} and ${EXPORT_DIR}/${EXPORT_FILENAME_ARCHIVE}"
# Copying canto_server_export_latest.json to archive
log "Copying ${EXPORT_FILENAME} to ${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE}"
parallel cp -v "${EXPORT_DIR}/${EXPORT_FILENAME}" ::: "${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE}" "${EXPORT_DIR}/${EXPORT_FILENAME_ARCHIVE}"
cp "${EXPORT_DIR}/${EXPORT_FILENAME}" "${ARCHIVE}/${EXPORT_FILENAME_ARCHIVE}"
log "Finished"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment