本文将介绍Linux下/tmp目录的清理规则,rhel6和rhel7将以完全不同的两种方式进行清理. RHEL6 tmpwatch命令 tmpwatch 是专门用于解决“删除 xxx天没有被访问/修改过的文件”这样需求的命令. 安装: [root@sam01 ~]# yum install tmpwatch.x86_64 使用: man tmpwatch tmpwatch - removes files which haven't been accessed for a period of ti…
在Linux系统中/tmp文件夹下的文件是会被清理.删除的,文件清理的规则是如何设定的呢? 以Redhat为例,这个主要是因为作业里面会调用tmpwatch命令删除那些一段时间没有访问的文件. 那么什么是tmpwatch呢?其实tmpwatch是一个命令或者说是一个包.如下所示 tmpwatch - removes files which haven't been accessed for a period of time [root@DB-Server ~]# rpm -qa | grep t…