/usr/bin/globus-gass-cache-destroy is in globus-gass-cache-program 6.4-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | #! /bin/sh
#
# Copyright 1999-2006 University of Chicago
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
prefix="${GLOBUS_LOCATION-prefix}"
exec_prefix="${prefix}"
sbindir="${exec_prefix}/sbin"
bindir="${exec_prefix}/bin"
includedir="${prefix}/include/globus"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
libexecdir="${datadir}/globus"
sysconfdir="/etc"
sharedstatedir="/var/lib"
localstatedir="/var"
PATH="${bindir}:${sbindir}:${PATH}"
# defaults list of machine to clean
TARGETS=${HOME}/.globus/my-contacts
# command to list it, will be replaced with a simple echo if one machine specified
CAT_TARGETS="[ -r \${TARGETS} ] && cat \${TARGETS}"
###############################################################################
# USAGE
Usage()
{
echo "globus-gass-cache-destroy [ -t <machine> | -f <file> ]"
echo " Will destroy (clean without coherence check) the globus cache"
echo " on all the machine listed in ~/.globus/my-contacts, "
echo " or in <file> if -f option used, or only on the machine"
echo " specified with the -t option."
exit 1
}
###############################################################################
clean_one()
{
TARGET_MACH="${1}"
TMPSCRIPT="${local_tmpdir}/cdscript$$"
rm -rf $TMPSCRIPT > /dev/null 2>&1
cat > $TMPSCRIPT <<MYEND
(\sleep \$CACHE_SLEEP_TIME; \rm -rf \$HOME/.globus/.gass_cache)> /dev/null 2>&1 < /dev/null&
if test "\$CACHE_SLEEP_TIME" = "0"; then
wait
fi
echo successful
exit 0
MYEND
if command -v globus-hostname > /dev/null ; then
SELF_MACH="$(globus-hostname)"
elif command -v hostname > /dev/null; then
SELF_MACH="$(hostname)"
elif command -v uname > /dev/null; then
SELF_MACH="$(uname -n)"
fi
case "${TARGET_MACH}" in
localhost|localhost.localdomain|${SELF_MACH})
RESULT=`CACHE_SLEEP_TIME=0 sh $TMPSCRIPT`
;;
*)
RESULT=`echo "" | globusrun -s -r "${TARGET_MACH}" "&(environment=(CACHE_SLEEP_TIME 60))(executable=/bin/sh)(library_path=\\$(GLOBUS_LOCATION)/lib)(arguments=\\$(GLOBUSRUN_GASS_URL)$TMPSCRIPT)" 2>&1`
;;
esac
THIS_STATUS=$?
if [ $THIS_STATUS -ne 0 ]
then
echo "Cleaning failed: " 1>&2
echo "$RESULT" 1>&2
rm -rf $TMPSCRIPT > /dev/null 2>&1
exit $THIS_STATUS
fi
rm -rf $TMPSCRIPT > /dev/null 2>&1
if [ "x$RESULT" != "xsuccessful" ]
then
echo "globus-gass-cache-destroy: $RESULT" 1>&2
fi
}
###############################################################################
# main
###############################################################################
#save the arguments
allargs="$@"
while [ $# -ge 1 ]; do
arg="$1"
case "${arg}" in
-f )
shift
if [ $# -ge 1 ]
then
TARGETS="$1"
shift
else
Usage
fi
;;
-t )
shift
if [ $# -ge 1 ]
then
CAT_TARGETS="echo \"$1\""
shift
else
Usage
fi
;;
-h|-help|--help )
Usage
;;
*)
echo "Unknown parameter ${arg}" 1>&2
exit 1
;;
esac
done
eval $CAT_TARGETS | awk -F: '{print $1}' | sort | uniq | while read TARGET; do
clean_one "${TARGET}"
done
|