zoukankan      html  css  js  c++  java
  • 写了一个shell,删除15天以上日志

    #!/bin/bash
    #author:qinliang
    #date:1.7.2020
    #note:keep 15 days log
    location1="/data/backup/xxx"
    location2="/data/log/xxx"
    location3="/data/log/xxxx/xx"
    location4="/data/log/xxxx/xx"
    location5="/data/log/xxxx/xx"

    find $location1 -mtime +15 -type d |xargs rm -rf;
    find $location2 -mtime +15 -name "[0-9]*.log" -exec rm -rf {} ;
    find $location3 -mtime +15 -name "curl2_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "lopt_refere_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "login_oas_nk_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "get_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "db2_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "db_*.log" -exec rm -rf {} ;
    find $location4 -mtime +15 -name "curl2_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "lopt_refere_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "get_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "download_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "db_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "curl2_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "curl_*.log" -exec rm -rf {} ;
    find $location5 -mtime +15 -name "client_open_*.log" -exec rm -rf {} ;

  • 相关阅读:
    团队第三次作业-王者终篇
    第二次团队任务之个人
    团队作业总和
    本次分工
    【软件工程】第一次作业
    面向对象第三次作业(向计算器进发)
    面向对象程序设计第二次作业(1)
    面向对象程序设计第二次作业(2)
    我的大一上(福州)
    第一周例行报告
  • 原文地址:https://www.cnblogs.com/ccielife/p/12162918.html
Copyright © 2011-2022 走看看