• X 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

  • 相关阅读:
    添加组合索引时,做相等运算字段应该放在最前面
    常用位运算
    redis php扩展简单使用
    mysql优化之简单概念
    mysql优化之sql语句优化
    简单画图 gd库函数
    win下 安装mongodb
    伪静态之实际应用
    tomcat win简单配置
    docker
  • 原文地址:https://www.cnblogs.com/chendian0/p/13218130.html
Copyright © 2020-2023  润新知