2 Replies Latest reply: Jan 11, 2013 12:26 AM by user12033531 RSS

    Weblogic Gc Logs Rotation Daily

    ManivelJaya
      Hi all,

      I am generated gc.log.But i want to rotate new gc.log file for that day in web logic 9.2.How to rotate new gc.log file for that day?.But i don't want delete old gc.log file.I want old gc.log file rename to previous day date.help me


      Thanks & Regards,
      J Manivel
        • 1. Re: Weblogic Gc Logs Rotation Daily
          Fabian
          Hi Manivel,

          Save this below file as log.sh

          log_path="/opt/app/weblogic/"
          source_path="/var/log/"
          cd $log_path
          date=`date +%d%m%y`
          cp gc.log gc.log_$date
          *>gc.log*
          mv gc.log_* $source_path

          Just change log_path and source_path,can place anywhere on server,
          Execute it as ./log.sh

          You can set it on cron to execute it daily.
          for example:assuming you have saved the file in /opt/monitoring

          58 23 * * * /opt/monitoring/log.sh > /dev/null &

          Regards,
          Fabian
          • 2. Re: Weblogic Gc Logs Rotation Daily
            user12033531
            Thanks for Your Reply Fabian
            But i want to rotate the GC Logs on windows For Every 1 hr
            A new GC Log file has to create for every 1hr
            Kindly provide the solution ASAP

            Regards
            Manivel J