一、CentOS系统/tmp目录里面的文件默认保留多久

  CentOS6默认保留30天,CentOS7默认保留10天

一、CentOS7系统/tmp目录里面的文件默认保留多久

  CentOS7默认保留10天,查看系统配置如下

[root@v05-docker-net-test02 ~]# cd /usr/lib/tmpfiles.d/
[root@v05-docker-net-test02 tmpfiles.d]# ls
etc.conf iptraf-ng.conf libselinux.conf pam.conf python.conf rpm.conf selinux-policy.conf systemd.conf tmp.conf var.conf
initscripts.conf legacy.conf lvm2.conf ppp.conf rpcbind.conf sap.conf sudo.conf systemd-nologin.conf tuned.conf x11.conf
[root@v05-docker-net-test02 tmpfiles.d]# cat tmp.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version. # See tmpfiles.d() for details # Clear tmp directories separately, to make them easier to override
# 默认保留时间变为了10天,如果这10天内没做任何调整,会被处理
v /tmp root root 10d
v /var/tmp root root 30d # Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp

二、CentOS6系统/tmp目录里面的文件默认保留多久

  CentOS6默认保留30天,查看系统配置如下

root@v01-apppre-mobile01 ~]# cd /etc/cron.daily
[root@v01-apppre-mobile01 cron.daily]# ls
logrotate makewhatis.cron mlocate.cron prelink readahead.cron tmpwatch
[root@v01-apppre-mobile01 cron.daily]# cat logrotate
#!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit
[root@v01-apppre-mobile01 cron.daily]# cat tmpwatch
#! /bin/sh
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \
-X '/tmp/hsperfdata_*' -X '/tmp/.hdb*lock' -X '/tmp/.sapstartsrv*.log' \
-X '/tmp/pymp-*' 10d /tmp
/usr/sbin/tmpwatch "$flags" 30d /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 30d "$d"
fi
done

CentOS系统/tmp目录里面的文件默认保留多久的更多相关文章

  1. Linux(centos)系统各个目录的作用详解

    Linux(centos)系统各个目录的作用详解 文件系统的类型 LINUX有四种基本文件系统类型:普通文件.目录文件.连接文件和特殊文件,可用file命令来识别. 普通文件:如文本文件.C语言元代码 ...

  2. 线上系统/tmp 目录不断增长分析与总结

    1.问题描述 系统配置为单核4G, web 工程配置堆2G,  /tmp目录 二进制文件不断增加,平均一天增加20G, 手动清理/tmp目录,重启系统,问题依旧. 2.分析 /tmp 目录存放系统运行 ...

  3. 关于/tmp/ 目录自动清理文件

    问题:今天开发人员给我说了一个错误:The temporary upload location [/tmp/tomcat.1337767218595042057.80/work/Tomcat/loca ...

  4. Linux(centos)系统各个目录的作用详解 推荐

    文件系统的类型 LINUX有四种基本文件系统类型:普通文件.目录文件.连接文件和特殊文件,可用file命令来识别. 普通文件:如文本文件.C语言元代码.SHELL脚本.二进制的可执行文件等,可用cat ...

  5. 修改定时清理 /tmp 目录下的文件

    初衷 默认系统是超过 30 天不访问的文件自动清除的,但是有时候硬盘用得紧可以考虑修改周期 设置方法 编辑配置文件:vim /etc/cron.daily/tmpwatch #! /bin/sh fl ...

  6. linux系统各目录存储的文件类型

    /etc 存储各种配置文件 /etc/init.d/ 目录下包含许多系统各种服务的启动和停止脚本.具体可见:http://blog.csdn.net/gongweijiao/article/detai ...

  7. CentOS系统磁盘目录空间调整

    前几天装了几台linux服务器,安装操作系统的时候,选择了默认磁盘分区,结果导致后面主目录分区空间不够用了,需要把其他分区的空间划分给主分区一点. 下面以CentOS6.5演示: 一.查看当前系统的磁 ...

  8. linux(CENTOS)系统各个目录的作用详解

    Linux(CentOS)系统各个目录的作用详解 文件的类型 LINUX有四种基本文件系统类型:普通文件.目录文件.连接文件和特殊文件,可用file命令来识别. 普通文件:如文本文件.C语言元代码.S ...

  9. springboot升级导致文件上传自动配置/tmp目录问题解决

    1,..\web\src\main\resources\spring\web-men-applicationContext.xml 保留原有的bean配置 <bean id="mult ...

随机推荐

  1. Python内置函数之-property

    property 是一个内置的装饰器函数,只在面向对象中使用 求一个圆的周长和面积 # 周长和面积都是通过类的方法得到from math import pi class Cricle: def __i ...

  2. Postgresql查询出换行符和回车符:

    1.有时候,业务因为回车和换行出现的错误,第一步,首先要查询出回车符和换行符那一条数据: -- 使用chr()和chr()进行查询 SELECT * )||)||'%'; -- 其实查询chr()和c ...

  3. module.exports与exports

    API文档是枯燥的,下面本人收集了一些论坛经常有人疑问和开源代码中经常遇到的案例供大家研究一下. module.exports与exports的区别 每一个node.js执行文件,都自动创建一个mod ...

  4. 英语口语练习系列-C35-马戏-谈论语言-己亥杂诗

    词汇-马戏 circus audience spectator spotlight bandstand magic magician clown spacious attractive product ...

  5. Spark环境搭建(二)-----------HDFS shell 常用操作

    配置好HDFS,也学习了点HDFS的简单操作,跟Linux命令相似 1)  配置Hadoop的环境变量,类似Java的配置 在 ~/.bash_profile 中加入 export HADOOP_HO ...

  6. [PA2014]Parking

    [PA2014]Parking 题目大意: 停车场是一个宽度为\(w(w\le10^9)\)的矩形.我们以其左下角顶点为原点,坐标轴平行于矩形的边,建立直角坐标系.停车场很长,我们可以认为它一直向右边 ...

  7. XVIII Open Cup named after E.V. Pankratiev. Grand Prix of Siberia

    1. GUI 按题意判断即可. #include<stdio.h> #include<iostream> #include<string.h> #include&l ...

  8. CSS(六)

    CSS权重 CSS权重指的是样式的优先级,有两条或多条样式作用于一个元素,权重高的那条样式对元素起作用,权重相同的,后写的样式会覆盖前面写的样式. 权重的等级 可以把样式的应用方式分为几个等级,按照等 ...

  9. java列表数据基本操作

    列表数据组基本的增删改查 package cn.edu.fhj.day002; import java.util.ArrayList; public class ArrList { // 定义一个主函 ...

  10. Codechef July Challenge 2018 : Subway Ride

    传送门 首先(想了很久之后)注意到一个性质:同一条边有多种颜色的话保留3种就可以了,这是因为假如最优解要求当前位置与相邻两条边都不相同,那么只要有3条边,就肯定可以满足这一点. 完事就做一个nlogn ...