原文:linux定時刪除歷史日志文件實現方式--shell腳本

tools目錄文件結構 root www tools tree tools tools bin del history files etc del history files.cfg directories, files 刪除歷史文件腳本 del history files root www tools more tools bin del history files bin sh 刪除指定目錄 ...

2020-05-21 10:17 0 676 推薦指數:

查看詳情

Linux定時刪除日志腳本

一、思路 定時刪除日志,其實分為兩個過程: 查找符合條件的日志刪除 定時 過程1需要寫一個查找腳本,過程2需要用到linux的crontab 二、查找並刪除 # vim delete-logs.sh 刪除指定目錄下7天以上的日志文件: find ...

Sun Jun 23 20:15:00 CST 2019 0 1423
Linux shell腳本 刪除日志文件保留最新的 3 條文件

1、查找目錄或文件 1.1 查找指定文件夾和文件 具體的示例: 命令 說明 -maxdepth 目錄深度,1 表示只搜索一級目錄 -name 后面跟文件夾或文件,多個文件夾或文件,用 -o 組合連接 jobs、config.xml 指定的文件夾和文件 1.2 直接文件 ...

Sat Nov 13 00:41:00 CST 2021 0 1009
linux定時刪除文件腳本

#! /bin/sh # 配置項DEBUG=truefolderDir=/var/www/html/hlsrecord/EXPIRE_DAY=1 # 過期時間和時間戳deadTime=`date - ...

Fri Nov 02 23:52:00 CST 2018 0 1970
linux腳本定時刪除文件

[root@ebs-46753 ~]# vi /etc/init.d/delete.sh 內容: #!/bin/bashdir=/upload/file/images/login/qrcode //要刪除文件文件夾路徑files=`ls ${dir}`for file ...

Wed Apr 29 23:12:00 CST 2020 0 1951
Shell定時刪除日志

vim del_log.sh #!/bin/bash location="/home/dl/code/logs" find $location -mtime +4 -type f | xargs rm -f #location 是刪除文件所在目錄 #-mtime +4 是設置刪除多少天 ...

Tue Jan 08 19:07:00 CST 2019 0 663
自動刪除文件腳本Linux shell腳本

定時執行的corn文件如下(每分鍾執行一次) 直接加入定時腳本中 另外service cron start可以正常啟動服務 一些網上的資料說 /sbin ...

Fri Oct 13 07:37:00 CST 2017 1 3735
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM