#!bin/bash
#获取年
time=$(date "+%Y") #查找并删除7天前的文件
find /opt/applog/travelsky -type f -mtime +7 -exec rm -f {} \;
find /xcx/hislogs/logs -type f -mtime +7 -exec rm -f {} \; #查找并删除7天前的文件
find /usr/local/proxy-web/logs -type f -mtime +7 -exec rm -f {} \; 查找并删除7天前的文件
find /var/www/html/wxsdairpro/log/ticket -mtime +7 -exec rm -f {} \;
查找并删除空目录
find /var/www/html/wxsdairpro/log/ticket/$time -exec rmdir -p {} \;
find /var/www/html/wxsdairpro/log/ticket/$time -mtime +7 -exec rm -f {} \; find /var/www/html/wxsdairpro/log/order -mtime +7 -exec rm -f {} \;
find /var/www/html/wxsdairpro/log/order/$time -exec rmdir -p {} \;
find /var/www/html/wxsdairpro/log/order/$time -mtime +7 -exec rm -f {} \; find /var/www/html/wxsdairpro/log/mohe -mtime +7 -exec rm -f {} \;
find /var/www/html/wxsdairpro/log/mohe/$time -exec rmdir -p {} \;
find /var/www/html/wxsdairpro/log/mohe/$time -mtime +7 -exec rm -f {} \; find /var/www/html/wxsdairpro/log/checkinsure -mtime +7 -exec rm -f {} \;
find /var/www/html/wxsdairpro/log/checkinsure/$time -exec rmdir -p {} \;
find /var/www/html/wxsdairpro/log/checkinsure/$time -mtime +7 -exec rm -f {} \; find /var/www/html/wxsdairpro/log/checkin -mtime +7 -exec rm -f {} \;
find /var/www/html/wxsdairpro/log/checkin/$time -exec rmdir -p {} \;
find /var/www/html/wxsdairpro/log/checkin/$time -mtime +7 -exec rm -f {} \;

centos定时删除log文件的更多相关文章

  1. SQLServer2005删除log文件和清空日志的方案

    数据库在使用过程中会使日志文件不断增加,使得数据库的性能下降,并且占用大量的磁盘空间.SQL Server数据库都有log文件,log文件记录用户对数据库修改的操作.可以通过直接删除log文件和清空日 ...

  2. SQLServer:删除log文件和清空日志的方法

    数据库的性能是DBA都需要重点关注的,日志文件的增多严重影响数据库的性能,本文将为您介绍SQL Server删除日志文件的方法,供您参考,希望对您有所帮助. 数据库在使用过程中会使日志文件不断增加,使 ...

  3. 删除log文件末尾中指定的行数

    /// <summary>        /// 删除log文件末尾中指定的行数        /// </summary>        /// <param name ...

  4. SQL SERVER数据库删除LOG文件和清空日志的方案

    原文:SQL SERVER数据库删除LOG文件和清空日志的方案 数据库在使用过程中会使日志文件不断增加,使得数据库的性能下降,并且占用大量的磁盘空间.SQL Server数据库都有log文件,log文 ...

  5. [转]SQL SERVER数据库删除LOG文件和清空日志的方案

    本文转自:https://www.cnblogs.com/ShaYeBlog/archive/2012/09/04/2670505.html 数据库在使用过程中会使日志文件不断增加,使得数据库的性能下 ...

  6. Linux shell crontab expdp 定时任务逻辑备份 定时删除旧文件

    点击进入:Window bat expdp 定时任务逻辑备份 定时删除N天前的旧文件 创建sh脚本 [oracle@localhost ~]$ vi logicbackup.sh 添加脚本内容 #!/ ...

  7. SQL Server删除log文件

    数据库文件太大 SQL Server用的久了,会发现备份文件越来越大,这个其实主要是log文件的增加,删掉log文件就可以了.不过操作之前最好还是有个完整备份的好. 分离数据库 分离数据库,勾选删除链 ...

  8. linux定时删除过期文件

    需求说明 每日凌晨0点定时删除/temp目录下的所有一个月未被访问的文件. 脚本实现 linux 终端输入crontab -e,添加定时任务脚本命令 [root@localhost ~]# cront ...

  9. centos定时删除指定日期之前的文件

    * 5 * * * find /tmp/* -name "yhwl_task.log*" -ctime +3 -exec rm -rf {} \; * 5 * * * find / ...

随机推荐

  1. SpringBoot集成Spring Security(3)——异常处理

    源码地址:https://github.com/jitwxs/blog_sample 文章目录 一.常见异常二.源码分析三.处理异常不知道你有没有注意到,当我们登陆失败时候,Spring securi ...

  2. Adams宏导出

    var set var=ip integer_value=1 var set var=macro_name str="" for variable_name=the_macro o ...

  3. SpringBoot之CommandLineRunner接口和ApplicationRunner接口

    我们在开发中可能会有这样的情景.需要在容器启动的时候执行一些内容.比如读取配置文件,数据库连接之类的.SpringBoot给我们提供了两个接口来帮助我们实现这种需求.这两个接口分别为CommandLi ...

  4. SourceTree 免登录

    SourceTree 是 Windows 和Mac OS X 下免费的 Git 和 Hg 客户端,拥有可视化界面,容易上手操作.同时它也是Mercurial和Subversion版本控制系统工具.支持 ...

  5. Java ReentrantLock中tryLock与lock的区别(非公平锁与公平锁)

    设置同步状态,利用CAS操作. // CAS操作:如果当前状态值等于期望值,则自动将同步状态设置为给定的更新值 protected final boolean compareAndSetState(i ...

  6. 024 如何让html引用公共的头部和尾部(多个html文件公用一个header.html和footer.html)

    前端静态html页面,封装公共的头文件(header:顶部页眉,顶部导航栏等部分)和尾部文件(footer:CopyRight.友情链接等部分) 当前方法:通过load()函数,引入公共头部和尾部文件 ...

  7. JavaIO学习:序列化流

    对象流 1.涉及到的类 ObjectInputStream 和 ObjectOutputStream 用于存储和读取基本数据类型数据或对象的处理流. 2.作用 ObjectOutputStream:内 ...

  8. CMake的含义和用法解读

    什么是 CMake 你或许听过好几种 Make 工具,例如 GNU Make ,QT 的 qmake ,微软的 MS nmake,BSD Make(pmake),Makepp,等等.这些 Make 工 ...

  9. SQlServer 变量定义 赋值

    declare @id int declare @name char(10) ;注意:char(10)为10位,要是位数小了会让数据出错 set @id=1 select @id=1 select @ ...

  10. 机甲大师S1机器人编程学习,Windows 10 安装Scratch和简单实例学习

    机甲大师S1支持 Scratch 3.0以上版本. Scratch官方网址:https://scratch.mit.edu/  最新版本为3.4.0 今天在Windows 10上,安装最新版本. 1. ...