• win 系统设置weblogic 进行定时自动重启并删除其日志和缓存文件,定时监控cpu是否达到100%并重启weblogic服务



    一:如何在win系统设置 任务管理:请百度查询 win系统设置 任务管理

      image

    0FQGG@GY_9$@IJ$_GC]~AV7

    二:设置 webogic 重启并删除垃圾文件的bat脚本

    sqlplus  /nolog   	@C:UsersAdministratorDesktopdrop_trigger.sql
    
    
    
    SETLOCAL
    
    set stop_DOMAIN_HOME=E:Weblogic_dimiansdomainsase_domainin
    
    call "%stop_DOMAIN_HOME%stopWebLogic.cmd" %*
    
    ENDLOCAL
    
    @rmdir /s/q E:Weblogic_dimiansdomainsase_domainserversAdminServerlogs  目录下的所有日志文件信息
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogs2*.* /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServercache*.* /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerdata*.* /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServer	mp*.* /s /q
    del C:UsersAdministratorAppDataLocalTempdatamodel*.* /s /q
    copy C:UsersAdministratorDesktoplog4j.properties  E:Weblogic_dimiansdomainsase_domainwarythWEB-INFclasseslog4j.properties
    copy  C:UsersAdministratorDesktoplicences_libpwp-core-2.0.1.20161101.20.jar   E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibpwp-core-2.0.1.20161101.20.jar
    copy  C:UsersAdministratorDesktoplicences_libpwp-framework-3.1.0.20171114.11.release.jar  E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibpwp-framework-3.1.0.20171114.11.release.jar
    copy  C:UsersAdministratorDesktoplicences_libgdsd-czjd-0.0.1-SNAPSHOT.jar  E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibgdsd-czjd-0.0.1-SNAPSHOT.jar
    
    
    SETLOCAL
    
    set DOMAIN_HOME=E:Weblogic_dimiansdomainsase_domain
    
    call "%DOMAIN_HOME%instartWebLogic.cmd" %*
    
    ENDLOCAL

    drop_trigger.sql

    conn SYNC_PLUS_1/SYNC_PLUS_1@192.168.1.168/pdborcl ;
    
    
     truncate table pwp_licence;
    
     quit;

    log4j配置

    ################ levl:DEBUG < INFO< WARN< ERROR<FATAL ; OFF/ ALL
    log4j.rootLogger =    CONSOLE ,logFile ,INFO  , ERROR  ,FATAL  ,  WARN
    
    dir = servers/AdminServer/logs/pwp-log
    
    # the dir of the tomcat input log
    # dir = ${catalina.home}
    
    # Set hibernate's log level to Info begin  
    log4j.logger.org.hibernate=WARN
    # log4j.logger.net.sf.hibernate=INFO
    log4j.logger.net.sf=WARN
    # Set hibernate's log level to Info end
    log4j.logger.org.jbpm=WARN
    log4j.logger.org.quartz=WARN
    
    
    log4j.logger.org.hibernate.SQL=INFO
    log4j.logger.org.apache.commons.beanutils.ConvertUtils=INFO
    log4j.additivity.org.apache.commons.beanutils.ConvertUtils=false
    
    log4j.logger.org.apache.commons.beanutils.BeanUtils=INFO
    log4j.additivity.org.apache.commons.beanutils.BeanUtils=false
    
    log4j.logger.org.apache = WARN
    #log4j.logger.org.apache.tomcat.util = INFO
    #log4j.logger.org.apache.commons = INFO
    #log4j.logger.org.apache.catalina = INFO
    #log4j.additivity.org.apache.tomcat.util = false
    #log4j.additivity.org.apache.commons = false
    log4j.logger.org.springframework=WARN
    #
    
    #CONSOLE
    #org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE = org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.Threshold = DEBUG
    log4j.appender.console.ImmediateFlush=true
    #System.out
    log4j.appender.CONSOLE.Target = System.err
    log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c - %m%n
    #
    # u65E5u5FD7u6587u4EF6(logFile) 
    log4j.appender.logFile=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.logFile.Threshold=DEBUG
    log4j.appender.logFile.ImmediateFlush=true
    log4j.appender.logFile.Append=true
    log4j.appender.logFile.File= ${dir}/logFile.log
    log4j.appender.logFile.DatePattern ='.'yyyy-MM-dd-HH-mm'.log'
    log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
    log4j.appender.logFile.layout.ConversionPattern=[%-5p] %d(%r) --> [%t] %l: %m %x %n
    #
    
    #INFO
    log4j.logger.com.alexgaoyh.util.INFO=INFO
    log4j.appender.INFO = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.INFO.layout = org.apache.log4j.PatternLayout
    log4j.appender.INFO.layout.ConversionPattern = "%p %d{yyyy-MM-dd HH:mm:ss} %-50.50c(%L) - %m%n
    log4j.appender.INFO.File = ${dir}/INFO.log
    log4j.appender.INFO.DatePattern ='.'yyyy-MM-dd-HH'.log'
    log4j.appender.INFO.Append = true
    log4j.appender.INFO.Threshold = INFO
    
    #
    
    #ERROR
    log4j.appender.ERROR = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.ERROR.Threshold = ERROR
    log4j.appender.ERROR.File = ${dir}/ERROR.log
    log4j.appender.ERROR.DatePattern ='.'yyyy-MM-dd-HH'.log'
    log4j.appender.ERROR.Append = true
    log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout
    log4j.appender.ERROR.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n
    #
    
    #FATAL
    log4j.appender.FATAL = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.FATAL.File = ${dir}/FATAL.log
    log4j.appender.FATAL.DatePattern ='.'yyyy-MM-dd-HH'.log'
    log4j.appender.FATAL.Append = true
    log4j.appender.FATAL.Threshold = FATAL
    log4j.appender.FATAL.layout = org.apache.log4j.PatternLayout
    log4j.appender.FATAL.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n
    #
    
    #WARN
    log4j.appender.WARN = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.WARN.File = ${dir}/WARN.log
    log4j.appender.WARN.DatePattern ='.'yyyy-MM-dd-HH'.log'
    log4j.appender.WARN.Append = true
    log4j.appender.WARN.Threshold = WARN
    log4j.appender.WARN.layout = org.apache.log4j.PatternLayout
    log4j.appender.WARN.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n
    #
    
    
    
    
    
    
    


    delete_log.bat

    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-loglogFile.log.*.* /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logERROR.log.*.*  /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logFATAL.log.*.*  /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logINFO.log.*.*  /s /q
    del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logWARN.log.*.*   /s /q





    A)MP]T$_28VGZ6~184E8~4B



    三:监测cpu是否100%,一旦100% 则重启weblogic 的bat

    @echo off
    for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Processor get PercentProcessorTime /value^|findstr "PercentProcessorTime"') do (
    set UseCPU=%%a
    )
    echo 111 CPU使用率:%UseCPU%%%
    SETLOCAL
    
    set stop_DOMAIN_HOME=C:UsersAdministratorDesktop
    
    if  %UseCPU% ==100  call "%stop_DOMAIN_HOME%
    eload_yth_7001.bat" %*
    
    ENDLOCAL
    
    if  %UseCPU% !=100     exit;


    ABTED0FR7IF8G9NSXAQ]YJP

  • 相关阅读:
    【(高职专科组)第十一届蓝桥杯省模拟赛答案】给定一个数列,请问找出元素之间最大的元素距离。
    【(高职专科组)第十一届蓝桥杯省模拟赛答案】给定一个数列,请问数列中最长的递增序列有多长。
    POJ 2391 二分+最大流
    HDU 4529 状压dp
    NYOJ 747贪心+dp
    NYOJ 745 dp
    HDU 2686 / NYOJ 61 DP
    HDU 4313树形DP
    HDU 4303 树形DP
    POJ 2342 树形DP
  • 原文地址:https://www.cnblogs.com/ios9/p/9145326.html
Copyright © 2020-2023  润新知