一、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. cf1153D 树形dp+思维

    一千八的题也不会做了呜呜呜 size[u]表示结点u下的叶子结点, 思维:可以想到一个子树对其父亲会有一个消耗值 考虑一个点如果是max,那么其最大值可以是size[u]-p,p是消耗值最小的子树 一 ...

  2. pta编程总结3

    7-1 抓老鼠啊~亏了还是赚了? (20 分) 某地老鼠成灾,现悬赏抓老鼠,每抓到一只奖励10元,于是开始跟老鼠斗智斗勇:每天在墙角可选择以下三个操作:放置一个带有一块奶酪的捕鼠夹(T),或者放置一块 ...

  3. Winform Focus()函数不起作用 解决办法

    private void Form_Load(object sender, EventArgs e) { this.txtName.Focus(); } 光标到不了txtName.可能的原因 TabI ...

  4. ansible的logging模块用来写日志

    [root@node-1 library]# cat dolog.py #!/bin/env python ANSIBLE_METADATA = { 'metadata_version': 'alph ...

  5. BeautifulSoup总结

    1. 参考 Beautiful Soup 4.2.0 文档 Beautiful Soup Documentation (4.4.0 英文部分内容有别于4.2.0中文) CSS 选择器参考手册 阮一峰 ...

  6. 一步步建立 Vue + Cesium 初始化项目

    一步步建立 Vue + Cesium 初始化项目 初始化 Vue 项目 升级 npm npm install -g npm 安装 @vue/cli 和 @vue/cli-service-global ...

  7. Petrozavodsk Summer-2017. Moscow IPT Contest

    A. A Place For My Head 留坑. B. New Divide 从高位到低位贪心,当这一位是$0$时,要尽量取$1$,维护高维后缀最小值进行判断即可. 时间复杂度$O((n+a)\l ...

  8. 归并排序&&归并排序求逆序对

    归并排序 归并排序(MERGE-SORT)是建立在归并操作上的一种有效的排序算法,该算法是采用分治法(Divide and Conquer)的一个非常典型的应用.将已有序的子序列合并,得到完全有序的序 ...

  9. ie下js不执行的几种可能

    1.首先考虑的就是代码是否有报错2.其次搜索代码中是否有console.log等测试的代码3.检查所用的方法是否兼容ie 以上是鄙人在开发过程中遇到的几种情况,抛砖来引玉~~

  10. [LeetCode] Convert Binary Search Tree to Sorted Doubly Linked List 将二叉搜索树转为有序双向链表

    Convert a BST to a sorted circular doubly-linked list in-place. Think of the left and right pointers ...