CentOS7下/tmp目录里面的文件默认保留多久

简介:

早上有同事问了下CentOS7下/tmp目录下文件目录保留多久,我记得CentOS6下默认好像是30天,CentOS7下不太确认,所以查了下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@kvm02 tmpfiles.d] # cd /usr/lib/tmpfiles.d/
[root@kvm02 tmpfiles.d] # ls
abrt.conf                 iscsi.conf           net-snmp.conf         rpcbind.conf         spice-vdagentd.conf   tuned.conf
cups.conf                 legacy.conf          openlmi-storage.conf  rpm.conf             svnserve.conf         var.conf
cups-lp.conf              libselinux.conf      pam.conf              samba.conf           systemd.conf          x11.conf
etc.conf                  libstoragemgmt.conf  ppp.conf              sap.conf             systemd-nologin.conf
gvfsd-fuse-tmpfiles.conf  lvm2.conf            python.conf           selinux-policy.conf  tmp.conf
initscripts.conf          mdadm.conf           radvd.conf            setroubleshoot.conf  tog-pegasus.conf
[root@kvm02 tmpfiles.d] # cat /usr/lib/tmpfiles.d/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(5) for details
# Clear tmp directories separately, to make them easier to override
v  /tmp  1777 root root 10d
v  /var/tmp  1777 root root 30d
# 默认保留时间变为了10天,如果这10天内没做任何调整,估计会被干掉
# Exclude namespace mountpoints created with PrivateTmp=yes
/tmp/systemd-private- %b-*
/tmp/systemd-private- %b-* /tmp
/var/tmp/systemd-private- %b-*
/var/tmp/systemd-private- %b-* /tmp

CentOS6的配置文件是在/etc/cron.daily下,有兴趣的朋友自己查下,网上资料比较多

参考资料:

https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7/

http://blog.csdn.net/zhidetian/article/details/51906335










本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1983723,如需转载请自行联系原作者
目录
相关文章
|
2月前
|
Linux 应用服务中间件 nginx
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
52 0
|
5月前
|
网络协议 Unix Linux
Centos下nfs+rpcbind实现服务器之间的文件共享
Centos下nfs+rpcbind实现服务器之间的文件共享
117 0
|
3月前
|
Java Shell Linux
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
100 0
|
5天前
|
存储 关系型数据库 Linux
CentOS如何使用Docker部署Plik服务并实现公网访问本地设备上传下载文件
CentOS如何使用Docker部署Plik服务并实现公网访问本地设备上传下载文件
27 4
|
1月前
|
Linux API 网络安全
centos7 图文详解精确同步企业实战 rsync include 同步指定文件exclude排除文件
centos7 图文详解精确同步企业实战 rsync include 同步指定文件exclude排除文件
10 0
|
1月前
|
网络协议 Linux 网络安全
centos7下最简单的 unison实现文件双向同步图文详解
centos7下最简单的 unison实现文件双向同步图文详解
16 0
|
3月前
|
Linux
centos7实现磁盘挂载,解挂,开机自动挂载,解决挂载文件覆盖问题
centos7实现磁盘挂载,解挂,开机自动挂载,解决挂载文件覆盖问题
148 0
|
5月前
|
Prometheus 监控 Cloud Native
Linux|centos7 Prometheus的自动服务发现 一(文件发现机制)
Linux|centos7 Prometheus的自动服务发现 一(文件发现机制)
58 0
|
5月前
|
Linux Shell
百度搜索:蓝易云【Linux(centos7)缺失.bashrc文件登录出现bash-4.2解决教程。】
或者你可以注销并重新登录系统,也会加载新的 `.bashrc` 文件。现在,你应该能够成功解决 "bash-4.2" 错误并登录到 CentOS 7 系统中。
61 0
|
存储 关系型数据库 Linux

热门文章

最新文章