/usr/bin/globus-gass-cache-destroy is in globus-gass-cache-program 5.2-3.
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 154 155 156 157 158 159 160 161 162 163 | #! /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.
#
if test -n "${GLOBUS_LOCATION}" ; then
prefix="${GLOBUS_LOCATION}"
else
prefix="/usr"
fi
exec_prefix="${prefix}"
sbindir="${exec_prefix}/sbin"
bindir="${exec_prefix}/bin"
libdir="${prefix}/lib"
includedir="${prefix}/include/globus"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
libexecdir="${datadir}/globus"
sysconfdir="/etc"
sharedstatedir="/var/lib"
localstatedir="/var"
aclocaldir="${datadir}/globus/aclocal"
. ${libexecdir}/globus-script-initializer
globus_source ${libexecdir}/globus-sh-tools.sh
# CVS Information:
# $Source: /home/globdev/CVS/globus-packages/gass/cache_program/source/globus-gass-cache-destroy.in,v $
# $Date: 2012/02/13 14:33:11 $
# $Revision: 1.3.12.1 $
# $Author: bester $
# 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} ] && ${GLOBUS_SH_CAT-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$$"
${GLOBUS_SH_RM-rm} -rf $TMPSCRIPT > /dev/null 2>&1
${GLOBUS_SH_CAT-cat} > $TMPSCRIPT <<MYEND
(\${GLOBUS_SH_SLEEP-sleep} \$CACHE_SLEEP_TIME; \${GLOBUS_SH_RM-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 test ${TARGET_MACH} = "localhost" -o ${TARGET_MACH} = "localhost.localdomain" -o ${TARGET_MACH} = "`${bindir}/globus-hostname`"; then
RESULT=`CACHE_SLEEP_TIME=0 ${bindir}/globus-sh-exec $TMPSCRIPT`
else
RESULT=`echo "" |${bindir}/globusrun -s -r "${TARGET_MACH}" "&(environment=(CACHE_SLEEP_TIME 60))(executable=\\$(GLOBUS_LOCATION)/bin/globus-sh-exec)(library_path=\\$(GLOBUS_LOCATION)/lib)(arguments=\\$(GLOBUSRUN_GASS_URL)$TMPSCRIPT)" 2>&1`
fi
THIS_STATUS=$?
if [ $THIS_STATUS -ne 0 ]
then
echo "Cleaning failed: " 1>&2
echo "$RESULT" 1>&2
${GLOBUS_SH_RM-rm} -rf $TMPSCRIPT > /dev/null 2>&1
exit $THIS_STATUS
fi
${GLOBUS_SH_RM-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 )
Usage
;;
-help )
Usage
;;
*)
echo "Unknown parameter ${arg}" 1>&2
exit 1
;;
esac
done
#eval $CAT_TARGETS | ${GLOBUS_SH_EGREP-egrep} '(fork|poe)' | ${GLOBUS_SH_AWK-awk} -F: '{print $1}' | ${GLOBUS_SH_SORT-sort} | ${GLOBUS_SH_UNIQ-uniq} | while read TARGET; do
#eval $CAT_TARGETS | ${GLOBUS_SH_SED-sed} '/fork/ p;/poe/ p; d' | ${GLOBUS_SH_AWK-awk} -F: '{print $1}' | ${GLOBUS_SH_SORT-sort} | ${GLOBUS_SH_UNIQ-uniq} | while read TARGET; do
eval $CAT_TARGETS | ${GLOBUS_SH_AWK-awk} -F: '{print $1}' | ${GLOBUS_SH_SORT-sort} | ${GLOBUS_SH_UNIQ-uniq} | while read TARGET; do
clean_one "${TARGET}"
done
|