cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Unix/Linux startup scripts

MarkPlimley
6-Contributor

Unix/Linux startup scripts

Gurus,

Can someone provide a sample *NIX start script for Tomcat and/or Windchill? We followed a Suggested Technique or something I found (sorry, lost the reference) for scripts to put in the init.d folder, using the 'nohup' prefix to launch. If we run the scripts, we get terminal windows opening up for Tomcat, ServerManager and the MethodServer. Then when we log out, the windows close and these services die.

Here is a code snippet:

cmdtext="starting"
echo "tomcat $cmdtext."
status=`nohup $CATALINA_HOME/bin/wttomcat_start $2>&1`

Do we need to set the DISPLAY variable to null to force output from these scripts to go to the log files? Should we be running the actual start command as a background job?

Appreciate any and all suggestions to resolve this.


Mark Plimley NxRev, Inc.
PLM Implementer/Trainer


2 REPLIES 2

On 11/23/10 12:02, Mark Plimley wrote:
> Gurus,
>
> Can someone provide a sample *NIX start script for Tomcat and/or Windchill? We

See attached for what I use here on Solaris. This script lives at:

/etc/rc3.d/S92windchill

> followed a Suggested Technique or something I found (sorry, lost the reference)
> for scripts to put in the init.d folder, using the 'nohup' prefix to launch. If
> we run the scripts, we get terminal windows opening up for Tomcat, ServerManager
> and the MethodServer. Then when we log out, the windows close and these services
> die.
>
> Here is a code snippet:
>
> cmdtext="starting"
> echo "tomcat $cmdtext."
> status=`nohup $CATALINA_HOME/bin/wttomcat_start $2>&1`
>
> Do we need to set the DISPLAY variable to null to force output from these
> scripts to go to the log files? Should we be running the actual start command as
> a background job?

The ootb xterms are nice for the install because you have the xterm windows
opening after installation for that "warm fuzzy feeling". In production use
however the xterms are worse than useless. You can get rid of them by following
the instructions here:

Attached is what I usually do:

Note: If you have partslink, you have to change the actual PL_start.sh to incorporate set_env.sh:

PL_start.sh

#!/bin/sh

JAVA_HOME=/usr/java/latest
WORK_DIR=/ptc/Windchill/partslink
TOMCAT_HOME=/ptc/Tomcat
CATALINA_HOME=$TOMCAT_HOME
PL_CONFIGFILE=$WORK_DIR/conf/main.properties
PL_CLASSPATH=$WORK_DIR/codebase/WEB-INF/classes:codebase/WEB-INF/lib/CounterPartWeb.jar:codebase/WEB-INF/lib/ptlWeb.jar:lib/OracleThinDrivers.jar:lib/PartsLinkService.jar:lib/SDbase.jar:lib/SDsqlserver.jar:lib/SDutil.jar:lib/commons-lang.jar

export JDK_PATH WORK_DIR TOMCAT_HOME CATALINA_HOME PL_CONFIGFILE PL_CLASSPATH

cd $WORK_DIR

MAX_MEMORY=128

$JAVA_HOME/bin/java -Xmx${MAX_MEMORY}m -cp $PL_CLASSPATH nitidus.util.rmi.cServerManager $PL_CONFIGFILE

I created a wcappctl file in /ptc/Shortcuts, /ptc/links/, or $WT_HOME/bin. I can improve it to check on processes prior to starting other dependant apps. But, here is what I have:

#!/bin/sh
# chkconfig: 345 99 10
# description: Windchill Applicaitons auto start-stop script.
#
LOGMSG="logger -puser.alert -s "
# Setting the environments paths
export ORACLE_HOME=/ptc/oracle/products/client/11G
export WT_HOME=/ptc/Windchill
export PARTSLINK_HOME=$WT_HOME/partslink
export JAVA_HOME=/usr/java/latest
export TOMCAT_HOME=/ptc/Tomcat
export CATALINA_HOME=$TOMCAT_HOME
export COGNOS_HOME=/ptc/Reporting
export DIRECTORY_SERVER_HOME=/ptc/DirectoryServer/server
export APACHE_HOME=/ptc/Apache
export LOGS_HOME=/ptc/ArchiveLogs
export FASTSEARCH=/ptc/IndexSearch/InStream_5.1/instream
export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib
export SQLPATH=$WT_HOME/db/sql3:$ORACLE_HOME/sqlplus/admin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=plmora
export ORAENV_ASK=NO
export NLS_LANG=American_America.utf8

# Set environment paths
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$APACHE_HOME/bin:$TOMCAT_HOME/bin:$WT_HOME/bin:PARTSLINK_HOME/bin:$COGNOS_HOME/bin:$ANT_HOME/bin:$ORACLE_HOME/bin:$PATH:.

# Set WC_OWNER to the user id of the owner of the Windchill Applications
export WC_OWNER=wcadmin

# Set INDEX_OWNER to the user id of the owner of the Instream FastSearch Applicaitons
export INDEX_OWNER=instream
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
/bin/chmod -R 777 $LOGS_HOME

/ptc/links/wc_status.sh

case "$1" in
'start')
echo "Make sure there are no hanging or running java processes for a full start"
echo "Make sure there are no hanging or running java processes for a full start" >> $LOGS_HOME/wcstart.log 2>&1
$JAVA_HOME/bin/java -jar /ptc/links/JavaCleanup.jar -kill >> $LOGS_HOME/wcstart.log 2>&1
echo "Trimming All Windchill Application Logs"
/ptc/links/LogTrimming.sh
echo "Starting All Windchill Applications:"
echo "Starting Directory Server, Instream, Cognos, Windchill, Tomcat and Apache "
echo "Ensuring Aphelion is not running"
/ptc/Aphelion/instTemp/cdsDaemon stop >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Directory Server"
$DIRECTORY_SERVER_HOME/bin/start-ds >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Instream Index Search"
/bin/su - $INDEX_OWNER -c "$FASTSEARCH/bin/nctrl start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Cognos"
/bin/su - $WC_OWNER -c "/ptc/Reporting/bin/cogconfig.sh -s" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_start.sh &" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Tomcat(s)"
rm -rf $TOMCAT_HOME/work
/bin/su - $WC_OWNER -c "/ptc/links/tomcat_start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Apache"
$APACHE_HOME/bin/apachectl -k start -D SSL >> $LOGS_HOME/wcstart.log 2>&1
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
/ptc/links/wc_status.sh
;;

'stop')
echo "Stopping All Windchill Applications:"
echo "Stopping Directory Server, Instream, Cognos, Windchill, Tomcat and Apache "
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Apache"
$APACHE_HOME/bin/apachectl stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Tomcat"
/bin/su - $WC_OWNER -c /ptc/links/tomcat_stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_stop.sh" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Cognos"
/bin/su - $WC_OWNER -c "/ptc/Reporting/bin/cogconfig.sh -stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Instream Index Search"
/bin/su - $INDEX_OWNER -c "$FASTSEARCH/bin/nctrl stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Directory Server"
$DIRECTORY_SERVER_HOME/bin/stop-ds >> $LOGS_HOME/wcstop.log 2>&1
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
sleep 60
echo "Kill any hanging or running java processes for a full stop"
echo "Kill any hanging or running java processes for a full stop" >> $LOGS_HOME/wcstop.log 2>&1
$JAVA_HOME/bin/java -jar /ptc/links/JavaCleanup.jar -kill >> $LOGS_HOME/wcstop.log 2>&1
/ptc/links/wc_status.sh
;;

'restart')
echo "Stopping All Windchill Applications:"
echo "Stopping Directory Server, Instream, Cognos, Windchill, Tomcat and Apache "
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Apache"
$APACHE_HOME/bin/apachectl stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Tomcat"
/bin/su - $WC_OWNER -c /ptc/links/tomcat_stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_stop.sh" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Cognos"
/bin/su - $WC_OWNER -c "/ptc/Reporting/bin/cogconfig.sh -stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Instream Index Search"
/bin/su - $INDEX_OWNER -c "$FASTSEARCH/bin/nctrl stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Directory Server"
$DIRECTORY_SERVER_HOME/bin/stop-ds >> $LOGS_HOME/wcstop.log 2>&1
date >> $LOGS_HOME/wcstop.log 2>&1
echo "Pause for 5 minutes"
sleep 300
echo "Kill any hanging java processes"
echo "Kill any hanging java processes" >> $LOGS_HOME/wcstop.log 2>&1
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
echo "Trimming All Windchill Application Logs"
/ptc/links/LogTrimming.sh
echo "Starting All Windchill Applications:"
echo "Starting Directory Server, Instream, Cognos, Windchill, Tomcat and Apache "
echo "Ensuring Aphelion is not running"
/ptc/Aphelion/instTemp/cdsDaemon stop >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Directory Server"
$DIRECTORY_SERVER_HOME/bin/start-ds >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Instream Index Search"
/bin/su - $INDEX_OWNER -c "$FASTSEARCH/bin/nctrl start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Cognos"
/bin/su - $WC_OWNER -c "/ptc/Reporting/bin/cogconfig.sh -s" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_start.sh &" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Tomcat(s)"
rm -rf $TOMCAT_HOME/work
/bin/su - $WC_OWNER -c "/ptc/links/tomcat_start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Apache"
$APACHE_HOME/bin/apachectl -k start -D SSL >> $LOGS_HOME/wcstart.log 2>&1
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
/ptc/links/wc_status.sh
;;

'quickstart')
echo "Quick Start of Windchill Applications:"
echo "Starting Windchill, Partslink, Tomcat and Apache "
echo "Starting Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_start.sh &" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Tomcat(s)"
rm -rf $TOMCAT_HOME/work
/bin/su - $WC_OWNER -c "/ptc/links/tomcat_start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Apache"
$APACHE_HOME/bin/apachectl -k start -D SSL >> $LOGS_HOME/wcstart.log 2>&1
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
/ptc/links/wc_status.sh
;;

'quickstop')
echo "Stopping Only Windchill Applications:"
echo "Stopping Windchill, PartsLink, Tomcat and Apache "
echo "Stopping Apache"
$APACHE_HOME/bin/apachectl stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Tomcat"
/bin/su - $WC_OWNER -c /ptc/links/tomcat_stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_stop.sh" >> $LOGS_HOME/wcstop.log 2>&1
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
/ptc/links/wc_status.sh
;;

'quickrestart')
echo "Stopping Windchill Applications:"
echo "Stopping only Windchill, PartsLink, Tomcat and Apache "
echo "Stopping Apache"
$APACHE_HOME/bin/apachectl stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Tomcat"
/bin/su - $WC_OWNER -c /ptc/links/tomcat_stop >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill stop" >> $LOGS_HOME/wcstop.log 2>&1
echo "Stopping Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_stop.sh" >> $LOGS_HOME/wcstop.log 2>&1
/bin/date >> $LOGS_HOME/wcstop.log 2>&1
echo "Pause for 2 minutes"
sleep 120
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
echo "Quick Start of Windchill Applications:"
echo "Starting only Windchill, Partslink, Tomcat and Apache"
echo "Starting Windchill PartsLink Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/partslink/bin/PL_start.sh" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Windchill Method Server"
/bin/su - $WC_OWNER -c "/ptc/Windchill/bin/windchill start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Tomcat(s)"
rm -rf $TOMCAT_HOME/work
/bin/su - $WC_OWNER -c "/ptc/links/tomcat_start" >> $LOGS_HOME/wcstart.log 2>&1
echo "Starting Apache"
$APACHE_HOME/bin/apachectl -k start -D SSL >> $LOGS_HOME/wcstart.log 2>&1
/bin/date >> $LOGS_HOME/wcstart.log 2>&1
/ptc/links/wc_status.sh
;;

'status')
/ptc/links/wc_status.sh
;;
*)
echo $"Usage: $0 {start|stop|restart|quickstart|quickstop|quickrestart|status}"
exit 1
esac

I also created a LogTrimming.sh file to nightly compress and backup the logs and trim them incase they grow and cause performance issues:

#!/bin/ksh

export WT_LOGS=/ptc/ArchiveLogs
export APACHE_HOME=/ptc/Apache
export TOMCAT_HOME=/ptc/Tomcat
export COGNOS_HOME=/ptc/Reporting
export WT_HOME=/ptc/Windchill
export DS_HOME=/ptc/DirectoryServer/server
export FASTSEARCH=/ptc/IndexSearch/InStream_5.1/instream
export JAVA_HOME=/usr/java/latest
export PATH=$JAVA_HOME/bin:$APACHE_HOME/bin:$TOMCAT_HOME/bin:$WT_HOME/bin:$JAVA_HOME/bin:$COGNOS_HOME/bin:/usr/bin:/sbin:$PATH

# Set WC_OWNER to the user id of the owner of the Windchill Applications
export WC_OWNER=wcadmin

# Set INDEX_OWNER to the user id of the owner of the Instream FastSearch Applicaitons
export INDEX_OWNER=instream

mkdir $WT_LOGS/$(date +%y%m%d)

## Nulling DirectoryServer Logs As Root
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/DirectoryServer.$(date +%y%m%d%H%M).jar $DS_HOME/logs/.
/bin/cat /dev/null > $DS_HOME/logs/access
/bin/cat /dev/null > $DS_HOME/logs/errors
/bin/cat /dev/null > $DS_HOME/logs/replication
/bin/cat /dev/null > $DS_HOME/logs/server.out

## Nulling Apache Logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/Apache.$(date +%y%m%d%H%M).jar $APACHE_HOME/logs/.
/bin/cat /dev/null > $APACHE_HOME/logs/error_log
/bin/cat /dev/null > $APACHE_HOME/logs/mod_jk.log
/bin/cat /dev/null > $APACHE_HOME/logs/access_log
/bin/cat /dev/null > $APACHE_HOME/logs/ssl_request_log

## Nulling Tomcat Logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/Tomcat.$(date +%y%m%d%H%M).jar $TOMCAT_HOME/logs/.
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $TOMCAT_HOME/logs/catalina.out"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $TOMCAT_HOME/logs/windchill.log"

## Nulling Windchill Logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/Windchill.$(date +%y%m%d%H%M).jar $WT_HOME/logs/.
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $WT_HOME/logs/DCA.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $WT_HOME/logs/HTTPGateway.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $WT_HOME/logs/BackgroundMethodServer.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $WT_HOME/logs/BackgroundMethodServerWVS1.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $WT_HOME/logs/BackgroundMethodServerWVS2.log"

## Nulling Cognos Logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/Cognos.$(date +%y%m%d%H%M).jar $COGNOS_HOME/logs/.
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/tomcat.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbs_cnfgtest_run.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbs_isrunning.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbs_run.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbs_start.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbs_stop.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cbsdefault.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/ccl.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cogconfigipf.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > $COGNOS_HOME/logs/cogserver.log"

## Nulling Instream Logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/Instream.$(date +%y%m%d%H%M).jar $FASTSEARCH/var/log/.
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/httpd.access_log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/httpd.error_log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/adminserver/sbc.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/adminserver/sfe.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/adminserver/silo-index-admin.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/adminserver/adminserver.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/anchorserver/anchorserver-storage.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/cachemanager/cachemanager.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/clarity/clarity.log/clarity_webcluster.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/configserver/configserver.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/contentdistributor/contentdistributor.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/crawler/crawler.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/esp4j-apps/logtransformer.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/esp4j-apps/resourceservice-stop.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/esp4j-apps/resourceservice.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/indexer/indexer.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/indexingdispatcher/indexingdispatcher.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/matcherserver/completionserver.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/nameservice/nameservice.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/nodecontroller/nctrl.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/procserver/procserver_1.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/qrserver/qrserver.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/rtsearch/dictionary_producer.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fdispatch-15700.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fdispatch-tld.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fsearch-0.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fsearch-1.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fdispatch-2.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/fdispatch-2_1.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/search-1.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/searchctrl/topfdispatch.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/syslog/all.log"
/bin/su - $INDEX_OWNER -c "/bin/cat /dev/null > $FASTSEARCH/var/log/syslog/lasterror.log"

## Nulling /var/logs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/var.$(date +%y%m%d%H%M).jar /var/log/.
/bin/cat /dev/null > /var/log/anaconda.log
/bin/cat /dev/null > /var/log/boot.log
/bin/cat /dev/null > /var/log/hp-fc-enablement.log
/bin/cat /dev/null > /var/log/hpUtil.log
/bin/cat /dev/null > /var/log/mysqld.log
/bin/cat /dev/null > /var/log/scrollkeeper.log
/bin/cat /dev/null > /var/log/Xorg.0.log
/bin/cat /dev/null > /var/log/yum.log
/bin/cat /dev/null > /var/log/tomcat5/catalina.out
/bin/cat /dev/null > /var/log/audit/audit.log
/bin/cat /dev/null > /var/log/cups/access_log
/bin/cat /dev/null > /var/log/cups/error_log
/bin/cat /dev/null > /var/log/gdm/0.log
/bin/cat /dev/null > /var/log/httpd/access_log
/bin/cat /dev/null > /var/log/httpd/error_log
/bin/cat /dev/null > /var/log/pm/suspend.log
/bin/cat /dev/null > /var/log/prelink/prelink.log


## Nulling /ptc/ArchiveLogs
$JAVA_HOME/bin/jar -cvf $WT_LOGS/$(date +%y%m%d)/ArchiveLogs.$(date +%y%m%d%H%M).jar /ptc/Archivelogs/.
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > /ptc/ArchiveLogs/wcstart.log"
/bin/su - $WC_OWNER -c "/bin/cat /dev/null > /ptc/ArchiveLogs/wcstop.log"

## This Script deletes all files under $WT_LOGS/$(date +%y%m%d) and $WT_HOME/logs that are
## have not been accessed within 7, 15 and 28 days respectfully
##
##
date
find $WT_HOME/logs $TOMCAT_HOME/logs $COGNOS_HOME/logs $DS_HOME/logs -mtime +7 -exec rm -f {} \;
find $WT_LOGS -mtime +28 -exec rm -f {} \;

Top Tags