写了一个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 {} \;