centos7中/tmp文件保存天数

不要在/tmp目录下保存文件,该目录会定期清理文件

/tmp默认保存10天

/var/tmp默认保存30天

配置文件:/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
# 默认保留时间变为了10天,如果这10天内没做任何调整,会被处理
v /tmp 1777 root root 10d
v /var/tmp 1777 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

相关文章

LinuxSystemd服务(2021.07.09)目录LinuxSystemd服务(2021.07...
opidrvabortingprocessM002ospid(3561)asaresultofORA-600OR...
安装好haproxy后,配置正确无法启动,看日志:Feb1309:32:50clu...
Linux 系统与服务管理工具Systemd被曝存在3大漏洞,影响几乎...
一、systemd查看日志文件有隐藏 systemctlstatusSERVICE-l-...
不要在mp目录下保存文件,该目录会定期清理文件mp默认保存10...