CentOS系統/tmp目錄裏面的文件默認保留多久

1、CentOS系統/tmp目錄裏面的文件默認保留多久

  CentOS6默認保留30天,CentOS7默認保留10天python

  1、CentOS7系統/tmp目錄裏面的文件默認保留多久

  CentOS7默認保留10天,查看系統配置以下linux

[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(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

  2、CentOS6系統/tmp目錄裏面的文件默認保留多久

  CentOS6默認保留30天,查看系統配置以下redis

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 != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
[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
相關文章
相關標籤/搜索