, 2 files 2、压缩历史文件脚本 gzip_history_files [root@www ...
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 推荐指数:
, 2 files 2、压缩历史文件脚本 gzip_history_files [root@www ...
一、思路 定时删除日志,其实分为两个过程: 查找符合条件的日志并删除 定时 过程1需要写一个查找脚本,过程2需要用到linux的crontab 二、查找并删除 # vim delete-logs.sh 删除指定目录下7天以上的日志文件: find ...
1、查找目录或文件 1.1 查找指定文件夹和文件 具体的示例: 命令 说明 -maxdepth 目录深度,1 表示只搜索一级目录 -name 后面跟文件夹或文件,多个文件夹或文件,用 -o 组合连接 jobs、config.xml 指定的文件夹和文件 1.2 直接文件 ...
#! /bin/sh # 配置项DEBUG=truefolderDir=/var/www/html/hlsrecord/EXPIRE_DAY=1 # 过期时间和时间戳deadTime=`date - ...
[root@ebs-46753 ~]# vi /etc/init.d/delete.sh 内容: #!/bin/bashdir=/upload/file/images/login/qrcode //要删除文件的文件夹路径files=`ls ${dir}`for file ...
vim del_log.sh #!/bin/bash location="/home/dl/code/logs" find $location -mtime +4 -type f | xargs rm -f #location 是删除文件所在目录 #-mtime +4 是设置删除多少天 ...
定时执行的corn文件如下(每分钟执行一次) 直接加入定时脚本中 另外service cron start可以正常启动服务 一些网上的资料说 /sbin ...