-v Verbose mode: displays live logs of rmcd to see tapes being mounted/dismounted in real time
-r Remove files at the end: launches the delete workflow on the files that were deleted. WARNING: THIS CAN BE FATAL TO THE NAMESPACE IF THERE ARE TOO MANY FILES AND XROOTD STARTS TO TIMEOUT.
EOF
exit 1
}
while getopts"d:e:n:s:p:vS:" o;do
while getopts"d:e:n:s:p:vS:r" o;do
case"${o}"in
e)
EOSINSTANCE=${OPTARG}
...
...
@@ -47,6 +51,9 @@ while getopts "d:e:n:s:p:vS:" o; do
S)
DATA_SOURCE=${OPTARG}
;;
r)
REMOVE=1
;;
*)
usage
;;
...
...
@@ -146,7 +153,7 @@ while test 0 != $(grep -c tapeonly$ ${STATUS_FILE}); do
let SECONDS_PASSED=SECONDS_PASSED+1
if test${SECONDS_PASSED}==${WAIT_FOR_RETRIEVED_FILE_TIMEOUT};then
echo"Timed out after ${WAIT_FOR_ARCHIVED_FILE_TIMEOUT} seconds waiting for file to be retrieved tape"
echo"Timed out after ${WAIT_FOR_RETRIEVED_FILE_TIMEOUT} seconds waiting for file to be retrieved tape"
break
fi
...
...
@@ -169,16 +176,84 @@ done
RETRIEVED=$(grep-c retrieved$ ${STATUS_FILE})
echo"###"
echo"${RETRIEVED}/${TAPEONLY} retrieved files"
echo"###"
LASTCOUNT=${RETRIEVED}
DELETED=0
if[[$REMOVE== 1 ]];then
echo"Waiting for files to be removed from EOS and tapes"
. /root/client_helper.sh
admin_kdestroy &>/dev/null
admin_kinit &>/dev/null
if$(admin_cta admin ls &>/dev/null);then
echo"Got cta admin privileges, can proceed with the workflow"
else
# displays what failed and fail
admin_cta admin ls
die "Could not launch cta command."
fi
# recount the files on tape as the workflows may have gone further...