Merge commit 'awips2_OB12.1.1_Omaha' into 4-Thin_Client

Conflicts:
	msi/AWIPSII.CAVE/AWIPSII.CAVE/ipr.gif
	msi/AWIPSII.CAVE/AWIPSII.CAVE/obj/x86/Release/_DELETE_ME_
	nativeLib/rary.cots.jepp/jepp-2.3/windows/Release/_DELETE_ME_

Chose to keep in 4-Thin_Client


Former-commit-id: 6d3d1066eb [formerly 221a02882a] [formerly b9f4780fcb] [formerly 6d3d1066eb [formerly 221a02882a] [formerly b9f4780fcb] [formerly 23cc9689de [formerly b9f4780fcb [formerly 0c520ee63a42d53754686f52ffa5b94a0fe4eea1]]]]
Former-commit-id: 23cc9689de
Former-commit-id: f3d32f34ce [formerly a85a777232] [formerly 601b02191762801f860cf28b52a200c6e003e7ea [formerly a2e3aabc60]]
Former-commit-id: 14ed1eaa2666eb1db1b97a732045d1fc5b864aba [formerly b2999a6d59]
Former-commit-id: 3598fb2fcd
This commit is contained in:
Steve Harris 2012-02-15 14:39:43 -06:00
commit f1abad69fd
7 changed files with 196 additions and 1 deletions

4
.gitignore vendored
View file

@ -5,4 +5,6 @@ test-bin/
testbin/
testBin/
bin-test/
*.class
*.pyo
*.o

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

View file

@ -0,0 +1,17 @@
#!/bin/bash
myPID=$$
echo -e "`date +%Y%m%d`\t`date +%H:%M:%S`\tStarting Script (pid = $myPID, parent = $PPID)" >> ~/logs/`basename $0 .sh`
if ps -wef|grep `basename $0` | grep -v grep | grep -v $myPID | grep -v $PPID
then
exit 0
fi
cd /data_store
while true
do
for _dir in `ls`
do
echo -e "`date +%Y%m%d`\t`date +%H:%M:%S`\t\tfind ${_dir} -mtime +0 -type f -exec rm -f {} \;" >> ~/logs/`basename $0 .sh`
find ${_dir} -mtime +0 -type f -exec rm -f {} \;
done
done

View file

@ -0,0 +1,176 @@
# $Id: scour.in,v 1.1.16.6.2.7 2009/07/16 19:27:13 steve Exp $
# Deletes old data files.
#
# Recursively deletes files older than a specified number of days from a
# specified set of directories. The directories, retention time in days,
# and an optional shell filename pattern appear, separated by tab characters
# one directory per line, in a configuration file named on the command line.
#
# If no files have been written under a directory since the last time scour was
# run, it will skip deleting old files and log an error message instead.
#
# WARNING: scour follows symbolic links, so don't put symbolic links to
# directories you don't want scoured under data directories.
PATH=/bin:/usr/bin
CONFFILE=/usr/local/ldm/etc/scour.conf # default, if no args
VERBOSEFLAG=
DEBUGFLAG=
ERRS=
PROG=`basename $0`
LOGGER="echo $PROG: "
TZ=UTC0 export TZ
LOG_LDM=local0
while [ "$1" != "" ]
do
case "$1" in
-v)
VERBOSEFLAG=1
;;
-x)
DEBUGFLAG=1
;;
-l) # logs to syslogd
LOGGER="logger -t $PROG -p $LOG_LDM.notice"
;;
-*)
$LOGGER "unrecognized flag ($1)"
ERRS=1
;;
*)
if [ $# -ne 1 ]
then
$LOGGER "only 1 conf file argument permitted"
ERRS=1
fi
CONFFILE=$1
;;
esac
shift
done
if [ "$ERRS" != "" ]
then
$LOGGER "usage: $PROG [-l] [-v] [-x] [config-file]"
exit 1
fi
if [ "$VERBOSEFLAG" != "" ]
then
$LOGGER "Starting Up"
fi
# Different find(1) utilities have different meanings for the "-mtime" argument.
# Discover the meaning for the find(1) utility that will be used.
#
dayOffsetName=scour_$$
trap 'rm -f /tmp/$dayOffsetName' EXIT
if touch /tmp/$dayOffsetName; then
sleep 2
#
# NOTE: OSF/1's find(1) utility doesn't conform to the Standard
# because the CWD must be changed in order to get this test to work.
#
dir=`pwd`
cd /tmp
if find $dayOffsetName -mtime 0 |
grep $dayOffsetName >/dev/null; then
DAY_OFFSET=1
elif find $dayOffsetName -mtime 1 |
grep $dayOffsetName >/dev/null; then
DAY_OFFSET=0
else
$LOGGER "Couldn't discover meaning of '-mtime' argument of find(1)"
exit 1
fi
cd $dir
rm /tmp/$dayOffsetName
else
$LOGGER "Couldn't create '-mtime' discovery-file /tmp/$dayOffsetName"
exit 1
fi
while read dir age pattern; do
if [ x$dir = x ] # ignore blank lines
then
continue
fi
case $dir in
\#*) # ignore comments
continue
;;
*)
if [ x$pattern = x ]
then
pattern="*"
fi
# Convert directory specification to absolute pathname: follow symbolic
# links (because find(1) doesn't) and perform tilde-expansion.
#
# NB: The statement
# edir=`csh -f -c "cd $dir && /bin/pwd"`
# causes the read(1) of the enclosing while-loop to return EOF if the
# directory doesn't exist.
#
if edir=`echo "cd $dir && /bin/pwd" | csh -f`; then
: true
else
$LOGGER "directory $dir does not exist, skipping"
continue
fi
if [ "$DEBUGFLAG" != "" ]
then
echo "dir=$dir age=$age pattern=$pattern edir=$edir"
fi
(
if cd $edir
then
# if either "$edir/.scour$pattern" doesn't exist yet OR
# there are files newer than "$edir/.scour$pattern"
# then
# delete old files and create "$edir/.scour$pattern"
# else
# skip deletions and log message
if [ ! -f ".scour$pattern" ] || \
[ -n "`find . -newer \".scour$pattern\" 2>/dev/null | \
head -1`" ]
then
FINDAGE=`echo $age $DAY_OFFSET - p|dc`
if [ "$VERBOSEFLAG" != "" ]
then
BEFORE=`du -s . 2>/dev/null | \
sed 's/^ *\([0-9]*\).*/\1/'`
fi
find . -type f -mtime +$FINDAGE -name "$pattern" -print \
| sed 's/\([^\n]\)/\\\1/g' \
| xargs rm -f && touch ".scour$pattern"
if [ "$VERBOSEFLAG" != "" ]
then
AFTER=`du -s . 2>/dev/null | \
sed 's/^ *\([0-9]*\).*/\1/'`
# set DELETED to max(0, BEFORE - AFTER)
DELETED=`echo $BEFORE $AFTER|\
sed 's/\([0-9]*\) \([0-9]*\).*/b=\1;a=\2;d=0;if(a<b)d=b-a;d/'|\
bc`
$LOGGER "$DELETED blocks from $edir/$pattern (>" \
"$age days old)"
fi
else
$LOGGER "skipping, no recent files in $edir/$pattern"
fi
fi
)
;;
esac
done < $CONFFILE
if [ "$VERBOSEFLAG" != "" ]
then
$LOGGER exiting ...
fi