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 {} ;

  • 相关阅读:
    iOS学习05C语言函数
    iOS学习04C语言数组
    iOS学习03C语言循环结构
    iOS学习02C语言分支结构
    iOS学习01C语言数据类型
    Objective-C学习——中文URL编码和解码
    Objective-c 字面量
    SDWebImage
    mac的svn之cornerstone简易教程
    javascript 和oc交互
  • 原文地址:https://www.cnblogs.com/ccielife/p/12162918.html
Copyright © 2011-2022 走看看