早上有同事问了下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 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的配置文件是在/etc/cron.daily下,有兴趣的朋友自己查下,网上资料比较多
参考资料:
http://blog.csdn.net/zhidetian/article/details/51906335
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1983723,如需转载请自行联系原作者