From f274da6181fed8788b870f9bd7105d3a6cb663f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 10 Jun 2008 09:41:47 +0000 Subject: [PATCH] glite-lb-bkpurge-offline.sh moved to lb.utils --- org.glite.lb.server/Makefile | 1 - .../src/glite-lb-bkpurge-offline.sh | 172 --------------------- 2 files changed, 173 deletions(-) delete mode 100644 org.glite.lb.server/src/glite-lb-bkpurge-offline.sh diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index 7130420..ee716a6 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -385,7 +385,6 @@ install: done ${INSTALL} -m 755 ${top_srcdir}/config/startup ${PREFIX}/etc/init.d/glite-lb-bkserverd - ${INSTALL} -m 755 ${top_srcdir}/src/glite-lb-bkpurge-offline.sh ${PREFIX}/bin/glite-lb-bkpurge-offline ${INSTALL} -m 644 ${top_srcdir}/interface/job-attrs.xsd ${PREFIX}/interface ${INSTALL} -m 644 ${top_srcdir}/interface/job-record.xsd ${PREFIX}/interface diff --git a/org.glite.lb.server/src/glite-lb-bkpurge-offline.sh b/org.glite.lb.server/src/glite-lb-bkpurge-offline.sh deleted file mode 100644 index 6b5bf84..0000000 --- a/org.glite.lb.server/src/glite-lb-bkpurge-offline.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash - -cat <&2 $0 probably already running! -fi - -if killall -0 glite-lb-bkserverd 2>/dev/null || killall -0 glite-lb-proxy 2>/dev/null -then -echo >&2 glite-lb-bkserverd or glite-lb-proxy running! -fi - -echo -echo -n "Continue (y/n)?"; read r -if [ "$r" = "y" ] -then echo Working... -else echo Aborting.; exit 1; -fi - - -getsecs() { - echo $(($(echo "$1" | sed -e 's/s$//' \ - -e 's/m$/*60/' \ - -e 's/h$/*3600/' \ - -e 's/d$/*86400/') )) -} - -now=$(date "+%s") - -tclause="" -add_tclause() { - case "$1" in - 6|7|8|9) spart="states.status=$1";; - o) spart="(states.status<6 OR states.status>9)";; - esac - if [ -z "$tclause" ]; then concat=""; else concat=" OR ";fi - tclause="$tclause$concat($spart AND states.jobid = es.jobid and states.seq = es.event AND es.arrived $tempfile1 - -ds="DELETE$quick FROM jobs,states,e,short_fields,long_fields,status_tags" -ds="$ds USING states" -ds="$ds LEFT JOIN events AS e ON (e.jobid = states.jobid)" -ds="$ds LEFT JOIN jobs ON (jobs.jobid = states.jobid)" -ds="$ds LEFT JOIN short_fields ON (short_fields.jobid = e.jobid AND short_fields.event=e.event)" -ds="$ds LEFT JOIN long_fields ON (long_fields.jobid = e.jobid AND long_fields.event=e.event)" -ds="$ds LEFT JOIN status_tags ON (status_tags.jobid = states.jobid)" - -#wc -l $tempfile1 /dev/null;echo -n "???";read n -( - cnt=0 - echo "SET autocommit=0;" - echo "BEGIN;" - while read jobid - do - echo "UPDATE acls,jobs SET acls.refcnt=acls.refcnt-1 " \ - "WHERE jobs.jobid='$jobid' AND jobs.aclid=acls.aclid;" - echo "$ds WHERE states.jobid='$jobid';" - if [ $(($cnt % 10)) = 9 ] - then - echo "COMMIT;" - echo "BEGIN;" - fi - cnt=$((cnt+1)) - done - echo "DELETE FROM acls WHERE refcnt=0;" - echo "COMMIT;" -) < $tempfile1 | $mysqlcmd -rm $tempfile1 -fi - -if [ "$thorough" = 1 ] -then - ( - for table in acls jobs status_tags events \ - short_fields states long_fields - do - echo "OPTIMIZE TABLE $table;" - done - ) | $mysqlcmd -fi - -# TODO: acls/singleshot, grey_jobs, notif_jobs, notif_registrations, users -- 1.8.2.3