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

Added test of sys.retrieves for retrieved files to client_ar.sh

parent 8a32d0bf
No related branches found
No related tags found
No related merge requests found
......@@ -188,14 +188,30 @@ LASTCOUNT=${RETRIEVED}
# in previous status mappings
eos root://${EOSINSTANCE} ls -y ${EOS_DIR} | sed -e 's/^\(d.::t.\).*\(test[0-9]\+\)$/\2 \1/;s/d[^0]::t[^0]/retrieved/;s/d[^0]::t0/copied/;s/d0::t0/error/;s/d0::t[^0]/tapeonly/' > ${STATUS_FILE}
echo "RAW STATUS_FILE (${STATUS_FILE})"
cat ${STATUS_FILE}
echo "LIST OF RETRIEVED FILES"
for RETRIEVED_FILE in `cat ${STATUS_FILE} | grep retrieved | awk '{print $NF;}'`; do
# The format of the STATUS_FILE is two space separated columns per line. The
# first column is the name of the file and the second is the status of the file.
# For example:
#
# test0000 retrieved
# test0001 retrieved
# test0002 retrieved
# test0003 retrieved
echo "CHECKING sys.retrieves HAS BEEN RESET FOR EACH RETRIEVED FILE"
for RETRIEVED_FILE in `cat ${STATUS_FILE} | grep retrieved | awk '{print $1;}'`; do
RETRIEVED_FILE_FULL_PATH=${EOS_DIR}/${RETRIEVED_FILE}
echo ${RETRIEVED_FILE_FULL_PATH}
SYS_RETRIEVES_ATTR_GET=`eos root://${EOSINSTANCE} attr get sys.retrieves ${RETRIEVED_FILE_FULL_PATH}`
if ! echo ${SYS_RETRIEVES_ATTR_GET} | egrep -q '^sys.retrieves='; then
die "Failed to get value of sys.retrieves for retrieved file ${RETRIEVED_FILE_FULL_PATH}"
fi
SYS_RETRIEVES_VALUE=`echo ${SYS_RETRIEVES_ATTR_GET} | tr '"' ' ' | awk '{print $NF;}'`
if test "0" != "${SYS_RETRIEVES_VALUE}"; then
die "ERROR sys.retrieves for ${RETRIEVED_FILE_FULL_PATH} is ${SYS_RETRIEVES_VALUE} when it should have been reset to 0"
fi
done
echo "sys.retrieves HAS BEEN SUCCESSFULLY RESET TO 0 FOR ALL RETRIEVED FILES"
DELETED=0
if [[ $REMOVE == 1 ]]; then
......
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