• 包月卡服务器维护


    #!/bin/bash
    set timeout 36000
    #program:
    # This program is used for del 7days ago logs;
    # Writen by lubing 2015-01-13  First release
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:
    export PATH
    /opt/jboss/bin/catalina.sh stop
    mv /opt/jboss/logs/catalina.out  /data/bakopt_jboss_logs_catalina.out/`date +%Y%m%d`_catalina.out
    sleep 3600
    /bin/touch   /opt/jboss/logs/catalina.out
    /bin/kill -9 `ps -ef |grep "/opt/jboss/runtime/bin/jboss" |awk -F"     " '{print $2}'|awk 'NR==2 {print}'`
    sleep 20
    /opt/jboss/bin/catalina.sh start

    [root@P_MONTHLY_APP001 ~]# cat /opt/jboss/logs/dell-7days-logs.sh
    #!/bin/bash
    #program:
    # this program used for backup mysql_log and delete the 7 days ago logs!
    # History:
    # 2015/01/01 lubing  First release
    PATH=/bin:/sbin/:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
    export PATH
    /bin/find /data/bakopt_jboss_logs_catalina.out -mtime +7 -name '*.out' -exec rm -rf  {} ;

  • 相关阅读:
    深入理解Java内存模型(JMM)
    Java基础知识①
    Java自旋锁的几种实现
    ConcurrentHashMap的CAS操作
    Java集合对比总结
    python模块--os模块
    python模块--random
    Datafactory 学习笔记
    Datafactory 实际使用案例
    Oracle三种排名函数使用
  • 原文地址:https://www.cnblogs.com/lubing666666/p/4402561.html
Copyright © 2020-2023  润新知