Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
script to rotate iwtrace.log
NathansDIS
Does anyone have a script that will stop the necessary services, rename iwtrace.log, and then restart the stopped services?
We are running TS 6.5 SP1 on Windows 2000. Any input, suggestions, flames, etc much appreciated.
-Nathan
Washington DIS
Find more posts tagged with
Comments
jbyork
This is quite lame, but it will take approximately 3 minutes to code and works just fine on Windows 2000.
Write a batch file which...
Kills all Interwoven services
Renames iwtrace.log (maybe include current date in new file name)
Starts Interwoven.
Batch file help reference:
http://www.computerhope.com/batch.htm
I assume a new iwtrace.log is created on start up if it's missing.
Perl or another scripting language is probably more eloquent... but alas, I'll be waiting to hear criticism from the nerdy peanut gallery.
Good luck!
anisha
Nathan, have you looked into techlib for aticles
53956
. These may not give the exact information you are looking for, but should be a good starting point to write the scripts.
iwovGraduate
I think you post a script for this yourself in a different
thread
?
Is that not doing the job ?
Migrateduser
Hello all,
We are using Interwoven TeamSite version 6.5.0 Service Pack 1 Build Number: 46458.
I've followed document 53956 and created a shell script to rotate our TeamSite log files:
#!/bin/sh
#What time is it? (eg: 27May-0630PM)
DATE=`/usr/bin/date +%d%h-%I%M%p`
#Number of days to keep the compressed log files
RMDAY=60
#List of Log files to rotate
LOGFILES=
LOGFILES="${LOGFILES} /usr/teamsite/iw-home/log/iwui/servletd.log"
LOGFILES="${LOGFILES} /usr/teamsite/iw-home/log/iwevents.log"
LOGFILES="${LOGFILES} /usr/teamsite/iw-home/log/iwserver.log"
for LOG in $LOGFILES; do
if [ -f $LOG ]; then
/usr/bin/cp -p $LOG $LOG.$DATE && > $LOG
/usr/local/bin/gnufind $LOG.?????-?????? -follow -type f -exec /usr/local/bin/bzip2 -9 {} \;
/usr/local/bin/gnufind $LOG.?????-??????.bz2 -follow -type f -mtime +$RMDAY -exec /usr/bin/rm {} \;
fi
done
This script will archive the log files off with the date appended, and then zero out the original file. If the copy fails for some reason, it will not zero out the file (wouldn't want to lose my data if the copy fails). After archiving the file, it zips it up and removes any other zipped files older than 60 days. I do not shutdown the TeamSite processes while rotating the log files as I am looking for a solution to rotate the TeamSite log files without restarting TeamSite.
The issue with this is the next time that log file is written to by the TeamSite process (say the /usr/teamsite/iw-home/log/iwui/servletd.log file when an invalid login occurs), the file fills up with Null Characters (^
@)
back to its original size and then continues to write the correct output to it. It's as if these files are stored in a buffer and the process freaks out when the size of these files are changed.
Has anyone else experienced this issue?
Adam Stoller
Do you ever backup your backing store?
If so - you should time the log rotation to occur during the period of time when the backing store is shut down to perform backups - that way you don't have to take it down especially to do the rotation.
Some folks have had success doing something like:
cp /dev/null $LOGFILE
while the server is running. Some folks have reported the null-byte issue with that - so your mileage may vary, but it's worth a shot. In either case however, there is a window in which your server has been running after the rotation and before the nullification - so you might lose some data.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com