The logs are rolling properly when we start bwagent using bwagent utility from the bin folder but getting the problem (bwagent clearing its logs after restart) when we start the bwagent by using the script.
Issue/Introduction
bwagent logs getting cleared when it's restarted by using script
Environment
All
Resolution
The problem is with the script which is used to start bwagent.
Please change > to >>
e.g. from nohup /opt/tibco/bw/6.4/bin/bwagent --propFile ${cfgfile} 2> ${logfile} >mob ${logfile} &
to nohup /opt/tibco/bw/6.4/bin/bwagent --propFile ${cfgfile} 2>> ${logfile} >>mob ${logfile} &
Note: > is used to overwrite (“clobber”) a file and >> is used to append to a file.
Due to ">" every time logs overwrite in the same bwappnode.logs instead of rolling. When we change ">" to ">>" it is appending the existing logs and logs are rolling properly.