I’ve got a web server that runs about eight JVMs. If a certain log file gets too large, the middleware server starts producing 1 GB log files every minute. The vendor had told us to restart the JVMs each night and we implemented the restart successfully through a custom action.
Now the vendor says we should check the file size between restarts. I used the fixlet debugger to confirm the relevance expression, but last night the script stopped the JVMs and then didn’t restart them. I’m presuming it got hung up on the deletion portion. We want to delete the entire contents of the log directory
// enter your action script here
wait net stop MarketLive_JVM1
wait net stop MarketLive_JVM2
wait net stop MarketLive_JVM3
if exists file “D:\log\batch_import” and (size of it) of file “D:\log\batch_import” < 102,400,000 then delete “D:\log*”
wait net start MarketLive_JVM1
wait net start MarketLive_JVM2
wait net start MarketLive_JVM3
Any idea why all of the net start statements are failing?
The log file shows the three services stopping successfully and then it finds the relevance expression non-relevant and stops. But it doesn’t continue on and run the net start commands:
I am not sure exactly why it didn’t report a failure, but it looks like your syntax for the if statement is not correct… I corrected the syntax and adjusted a few things to try to make it work better…
It should be something like this:
wait net stop MarketLive_JVM1
wait net stop MarketLive_JVM2
wait net stop MarketLive_JVM3
if {(exists file “D:\log\batch_import”) and (size of file “D:\log\batch_import” > 102400000)}
dos del "D:\log*.*"
endif
wait net start MarketLive_JVM1
wait net start MarketLive_JVM2
wait net start MarketLive_JVM3