head	1.8;
access;
symbols
	TIGRIS_1_1_0RC2:1.8
	TIGRIS_1_1_0RC1:1.8
	TIGRIS_1_1:1.8.0.12
	TIGRIS_1_0_8:1.8
	TIGRIS_1_0_8RC3:1.8
	TIGRIS_1_0_8RC2:1.8
	TIGRIS_1_0_8RC1:1.8
	TIGRIS_1_0_7:1.8
	TIGRIS_1_0_7RC3:1.8
	TIGRIS_1_0_7RC2:1.8
	TIGRIS_1_0_7RC1:1.8
	TIGRIS_1_0_6:1.8
	TIGRIS_1_0_6RC5:1.8
	TIGRIS_1_0_6RC4:1.8
	TIGRIS_1_0_6RC3:1.8
	TIGRIS_1_0_6RC2:1.8
	TIGRIS_1_0_6RC1:1.8
	TIGRIS_1_0_5:1.8
	TIGRIS_1_0_5RC6:1.8
	TIGRIS_1_0_5RC5:1.8
	TIGRIS_1_0_5RC4:1.8
	TIGRIS_1_0_5RC3:1.8
	TIGRIS_1_0_5RC2:1.8
	TIGRIS_1_0_5RC1:1.8
	TIGRIS_1_0_4:1.8
	TIGRIS_1_0_3:1.8
	TIGRIS_1_0_2:1.8
	TIGRIS_1_0_1:1.8
	TIGRIS_1_0:1.8.0.14
	TIGRIS_1_0_0:1.8
	TIGRIS_1_0_0_RC1:1.8.0.10
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.8
	TIGRIS_0_9_2_3:1.8
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.8
	TIGRIS_0_9_2_1:1.8
	TIGRIS_0_9_2:1.8.0.8
	TIGRIS_0_9_0:1.8.0.6
	TIGRIS_0_8_4:1.8.0.4
	TIGRIS_NOV_12_2000:1.8
	OLDHELM:1.8.0.2
	TIGRIS_NOV_11_2000:1.8
	TIGRIS_SEP_13_2000:1.7.0.2
	TIGRIS_BASELINE:1.7;
locks; strict;
comment	@# @;
expand	@o@;


1.8
date	2000.10.10.07.01.45;	author npm;	state Exp;
branches;
next	1.7;

1.7
date	2000.07.17.21.44.04;	author kfogel;	state Exp;
branches;
next	1.6;

1.6
date	2000.07.17.21.07.17;	author kfogel;	state Exp;
branches;
next	1.5;

1.5
date	2000.06.24.20.16.59;	author kfogel;	state Exp;
branches;
next	1.4;

1.4
date	2000.06.14.19.48.53;	author kfogel;	state Exp;
branches;
next	1.3;

1.3
date	2000.06.14.19.25.52;	author kfogel;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.13.20.52.52;	author kfogel;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.13.20.27.13;	author kfogel;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.28.09;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.8
log
@fixed/updated location of ~tigrisc/lock
@
text
@#!/bin/sh

###
### Search for stale lockfiles in repository, mail netbeans-admin if any.
###

# This script results from the following email of Niels <npm@@collab.net>: 
#
# > Using h02.sny:/home/npm/bin/cvs-locks I noticed some more locks in place
# > which I "fixed"...
# > 
# > Ops -- could someone take on the task of modifying the script I wrote 
# > so that it would print back files/dirs matching the existing pattern AND
# > more than one hour old. This would run once an hour from cron, and if
# > the result was ever  strictly larger than 0 characters, mail the output
# > to netbeans-admin.


# Number of minutes past which we think a lock might be "stale":
STALETIME=30

## If run interactively on a particular repository, then just print
## output to stdout:

INTERACTIVE=no
if [ "${1}X" = "X" ]; then
   LOCKDIR=~tigrisc/lock
else
   LOCKDIR=${1}
   INTERACTIVE=yes
fi

RCPT=netbeans-admin@@collab.net

find ${LOCKDIR} -cmin +${STALETIME} -name '*#*' \
     -printf '%Cc ........ ' -print > /tmp/cvs-locks$$

if [ -s /tmp/cvs-locks$$ ]; then
  if [ ${INTERACTIVE} = yes ]; then
    /bin/cat /tmp/cvs-locks$$
  else
    HOSTNAME=`hostname`
    /bin/cat /tmp/cvs-locks$$ \
      | /bin/mail -s "Stale CVS locks (${HOSTNAME}:${LOCKDIR})?" ${RCPT}
  fi
fi

/bin/rm /tmp/cvs-locks$$
@


1.7
log
@use '-cmin +N' syntax for finding stale files
@
text
@d27 1
a27 1
   LOCKDIR=/usr/tigris/tigrisc/locks
@


1.6
log
@testing this script
@
text
@d23 3
a25 1
## output to stdout.
a27 1
   INTERACTIVE=`false`
d30 1
a30 1
   INTERACTIVE=`true`
d35 1
a35 1
find ${LOCKDIR} -cmin ${STALETIME} -name '*#*' \
d39 1
a39 1
  if ${INTERACTIVE}; then
@


1.5
log
@Remove the tmp file unconditionally when done.
@
text
@a18 2
LOCKDIR=/usr/tigris/tigrisc/locks
RCPT=netbeans-admin@@collab.net
d22 12
d38 7
a44 2
  /bin/cat /tmp/cvs-locks$$ \
    | /bin/mail -s "Stale CVS lockfiles on NetBeans?" ${RCPT}
@


1.4
log
@do everything in 'find', for security
@
text
@a29 1
  /bin/rm /tmp/cvs-locks$$
d31 2
@


1.3
log
@use absolute paths for binaries
@
text
@d24 2
a25 1
FOUND=`find ${LOCKDIR} -cmin ${STALETIME} -name '*#*' -print`
d27 3
a29 5
if [ "${FOUND}X" != "X" ]; then
  for f in ${FOUND}; do
     /bin/ls -o --full-time ${f} >> /tmp/cvs-locks$$
  done
  /bin/cat /tmp/cvs-locks$$ | /bin/mail -s "Stale CVS lockfiles on NetBeans?" ${RCPT}
@


1.2
log
@Working as per Niels' instructions.
@
text
@d28 1
a28 1
     ls -o --full-time ${f} >> /tmp/cvs-locks$$
d30 2
a31 2
  cat /tmp/cvs-locks$$ | mail -s "Stale CVS lockfiles on NetBeans?" ${RCPT}
  rm /tmp/cvs-locks$$
@


1.1
log
@New lock-scrunger script for Niels (in progress).
@
text
@d20 3
a22 1
RECIPIENT=netbeans-admin@@collab.net
d24 1
a24 1
FOUND=`find ${LOCKDIR} -cmin 30 -name '*#*' -print`
d26 7
a32 1
echo "Found: '${FOUND}'"
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d19 2
a20 2
# Number of minutes past which we think a lock might be "stale":
STALETIME=30
d22 1
a22 2
## If run interactively on a particular repository, then just print
## output to stdout:
d24 1
a24 24
INTERACTIVE=no
if [ "${1}X" = "X" ]; then
   LOCKDIR=~tigrisc/lock
else
   LOCKDIR=${1}
   INTERACTIVE=yes
fi

RCPT=netbeans-admin@@collab.net

find ${LOCKDIR} -cmin +${STALETIME} -name '*#*' \
     -printf '%Cc ........ ' -print > /tmp/cvs-locks$$

if [ -s /tmp/cvs-locks$$ ]; then
  if [ ${INTERACTIVE} = yes ]; then
    /bin/cat /tmp/cvs-locks$$
  else
    HOSTNAME=`hostname`
    /bin/cat /tmp/cvs-locks$$ \
      | /bin/mail -s "Stale CVS locks (${HOSTNAME}:${LOCKDIR})?" ${RCPT}
  fi
fi

/bin/rm /tmp/cvs-locks$$
@


