早上有同事问了下CentOS7下/tmp目录下文件目录保留多久,我记得CentOS6下默认好像是30天,CentOS7下不太确认,所以查了下:
[[email protected] tmpfiles.d]# cd /usr/lib/tmpfiles.d/ [[email protected] 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 [[email protected] 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
时间: 2024-11-02 02:41:44