Skip to content
Snippets Groups Projects
Commit 3ae0c523 authored by Steven Murray's avatar Steven Murray
Browse files

Added the EOS wfe script delete_archive_file

parent 0699e8ee
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
export XrdSecPROTOCOL=sss
export XrdSecSSSKT=/etc/cta/cta-cli.sss.keytab
if test $# -ne 5; then
echo "Wrong number of command-line arguments"
echo "Usage: delete_archive_file wf_tag rusername rgroupname archive_file_id file_path"
exit -1
fi
WF_TAG="$1"
RUSERNAME="$2"
RGROUPNAME="$3"
ARCHIVE_FILE_ID="$4"
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}
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}
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}
exit 1
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