Skip to content
Snippets Groups Projects
Commit 85542ce1 authored by Vladimir Bahyl's avatar Vladimir Bahyl
Browse files

Cosmetics

parent b054a7da
No related branches found
No related tags found
No related merge requests found
This directory contains scripts to be executed by the EOS workflow engine.
These scripts should be installed in the foillowing directory on the EOS
These scripts should be installed in the following directory on the EOS
mgm node:
/var/eos/wfe/bash/
......
......@@ -11,16 +11,16 @@ TAPE_FS_ID="$3"
LOG_FILE="/var/log/eos/wfe/${WF_TAG}.log"
echo `date +%s` `date`" $0 Creating tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: creating tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
if ! eos -r 0 0 file tag "${FILE_PATH}" +${TAPE_FS_ID}; then
echo `date +%s` `date`" Failed to create tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: failed to create tape replica with fsid ${TAPE_FS_ID} for ${FILE_PATH}" >> ${LOG_FILE}
exit 1
fi
for DISK_FSID in `eos file info "${FILE_PATH}" -m | sed s/\ /'\n'/g | grep fsid | sed s/fsid=// | grep -v ${TAPE_FS_ID}`; do
echo `date +%s` `date`" $0 Deleting disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: deleting disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
if ! eos -r 0 0 file drop "${FILE_PATH}" ${DISK_FSID}; then
echo `date +%s` `date`" $0 Failed to delete disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: failed to delete disk replica with fsid ${DISK_FSID} for ${FILE_PATH}" >> ${LOG_FILE}
exit 1
fi
done
......@@ -20,14 +20,14 @@ FILE_PATH="$5"
LOG_FILE="/var/log/eos/wfe/${WF_TAG}.log"
if test UNDEF = ${ARCHIVE_FILE_ID}; then
echo `date +%s` `date`" $0 Ignoring deletion of non-existent tape archive file: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: ignoring deletion of non-existent tape archive file: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
exit 0
fi
if RESULT=`2>&1 /usr/bin/cta deletearchive --user ${RUSERNAME} --group ${RGROUPNAME} --id ${ARCHIVE_FILE_ID}`; then
echo `date +%s` `date`" $0 Deleted tape archive file: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: deleted tape archive file: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
exit 0
else
echo `date +%s` `date`" $0 Failed to delete tape archive file: error=${RESULT} rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: failed to delete tape archive file: error=${RESULT} rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} path=${FILE_PATH}" >> ${LOG_FILE}
exit ${ECANCELED}
fi
......@@ -26,14 +26,14 @@ DST_URL=${TURL}'\&eos.ruid=0&eos.rgid=0\&eos.injection=1\&eos.workflow=CTA_retri
LOG_FILE="/var/log/eos/wfe/${WF_TAG}.log"
if test UNDEF = ${ARCHIVE_FILE_ID}; then
echo `date +%s` `date`" $0 Cannot retrieve an archive file without the sys.archiveFileId attribute being set: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: cannot retrieve an archive file without the sys.archiveFileId attribute being set: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
exit ${ECANCELED}
fi
if RESULT=`2>&1 /usr/bin/cta retrieve --user ${RUSERNAME} --group ${RGROUPNAME} --id ${ARCHIVE_FILE_ID} --dsturl ${DST_URL} --diskfilepath ${FILE_PATH} --diskfileowner ${DISK_USERNAME} --diskfilegroup ${DISK_GROUPNAME} --recoveryblob:base64 ${METADATA_BASE64}`; then
echo `date +%s` `date`" $0 Queued retrieve request: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: queued retrieve request: rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
exit 0
else
echo `date +%s` `date`" $0 Failed to queue retrieve request: error=${RESULT} rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
echo `date +%s` `date`" $0: failed to queue retrieve request: error=${RESULT} rusername=${RUSERNAME} rgroupname=${RGROUPNAME} archiveFileId=${ARCHIVE_FILE_ID} dsturl=${DST_URL} disk_username=${DISK_USERNAME} disk_groupname=${DISK_GROUPNAME} path=${FILE_PATH}" >> ${LOG_FILE}
exit ${ECANCELED}
fi
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