Skip to content
Snippets Groups Projects
Commit f0ca5c8a authored by Michael Davis's avatar Michael Davis
Browse files

[ci] Changes client_ar.sh to use "tapefile ls" instead of "archivefile ls"

parent 24ff324a
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,23 @@ annotate() {
}
# Provide an EOS directory and list all filenames under that directory which are on tape.
# This replaces "cta-admin archivefile ls --all" which is deprecated in favour of "tapefile ls"
# Output is sent to stdout
tapefile_ls()
{
EOS_DIR=${1:-${EOS_BASEDIR}}
eos root://${EOSINSTANCE} find --fid ${EOS_DIR} |\
admin_cta --json tape ls --fidfile /dev/stdin |\
jq '.[] | .vid' |\
xargs admin_cta --json tapefile ls --lookupnamespace --vid |\
admin_cta --json tf ls --lookupnamespace --vid | jq '.[] | .df.path' |\
sed 's/"//g' |\
grep "^${EOS_DIR}"
}
while getopts "d:e:n:N:s:p:vS:rAPGt:m:" o; do
case "${o}" in
e)
......@@ -484,7 +501,7 @@ if [[ $REMOVE == 1 ]]; then
die "Could not launch cta-admin command."
fi
# recount the files on tape as the workflows may have gone further...
INITIALFILESONTAPE=$(admin_cta archivefile ls --all | grep ${EOS_DIR} | wc -l)
INITIALFILESONTAPE=$(tapefile_ls ${EOS_DIR} | wc -l)
echo "Before starting deletion there are ${INITIALFILESONTAPE} files on tape."
#XrdSecPROTOCOL=sss eos -r 0 0 root://${EOSINSTANCE} rm -Fr ${EOS_DIR} &
KRB5CCNAME=/tmp/${EOSPOWER_USER}/krb5cc_0 XrdSecPROTOCOL=krb5 eos root://${EOSINSTANCE} rm -Fr ${EOS_DIR} &
......@@ -511,7 +528,7 @@ if [[ $REMOVE == 1 ]]; then
echo "Timed out after ${WAIT_FOR_DELETED_FILE_TIMEOUT} seconds waiting for file to be deleted from tape"
break
fi
FILESONTAPE=$(admin_cta archivefile ls --all > >(grep ${EOS_DIR} | wc -l) 2> >(cat > /tmp/ctaerr))
FILESONTAPE=$(tapefile_ls ${EOS_DIR} > >(wc -l) 2> >(cat > /tmp/ctaerr))
if [[ $(cat /tmp/ctaerr | wc -l) -gt 0 ]]; then
echo "cta-admin COMMAND FAILED!!"
echo "ERROR CTA ERROR MESSAGE:"
......@@ -531,7 +548,7 @@ if [[ $REMOVE == 1 ]]; then
if [[ ${RETRIEVED} -gt ${DELETED} ]]; then
LASTCOUNT=${DELETED}
echo "Some files have not been deleted:"
admin_cta archivefile ls --all | grep ${EOS_DIR}
tapefile_ls ${EOS_DIR}
else
echo "All files have been deleted"
LASTCOUNT=${RETRIEVED}
......
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