FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit bf97529d authored by James Nairn's avatar James Nairn
Browse files

Change relative path

JSONIMPORTFILE is defined as /import_export/import-fbrfs.json which works when relative to Docker. When referencing the file outside of Docker it needs to be prefixed with . for the script to find import-export in the current working directory.
Fixed incorrect datestamp for JSONARCHIVE
parent 7ebe9785
No related branches found
No related tags found
1 merge request!6Testing
......@@ -219,21 +219,22 @@ if [[ -e ${CURATEDPAPERLISTFILE} ]]; then
fi
if [[ -e ${JSONIMPORTFILE} ]]; then
# As this is not running relative to Docker we need to prefix the path
# with . to choose import-export in current directory. Otherwise script would look in
# root of disk.
if [[ -e ".${JSONIMPORTFILE}" ]]; then
# Define filename
JSONARCHIVE="import-fbrfs_list_$(date +"%Y-%m-%d_%H:%M:%S")"
JSONARCHIVE="import-fbrfs_list_$(date +"%Y-%m-%d)"
# Copy /import_export/import-fbrfs.json to archive
log "Copying ${JSONIMPORTFILE} to ${ARCHIVE}/${JSONARCHIVE}"
log "Copying .${JSONIMPORTFILE} to ${ARCHIVE}/${JSONARCHIVE}"
# Copy file to archive with correct name
cp "${JSONIMPORTFILE}" "${ARCHIVE}/${JSONARCHIVE}"
# Copy file to archive with correct name
cp ".${JSONIMPORTFILE}" "${ARCHIVE}/${JSONARCHIVE}"
fi
exit 0
# Reset cache (restart memcached)
if /etc/init.d/memcached restart; then
log "Cache cleared successfully"
......
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