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

  • 相关阅读:
    mysql数据库 详解
    0810 smarty
    抽象类
    Nginx 负载均衡策略
    Nginx 负载均衡配置和策略
    内置Web Server
    PHP运行方式
    MySQL create table 语法
    MySQL 索引的使用
    MySQL的 explain 解析
  • 原文地址:https://www.cnblogs.com/ccielife/p/12162918.html
Copyright © 2011-2022 走看看