botang 发表于 2020-11-21 15:00:43

红帽7以后新的调度方法与临时文件删除机制

sysstat包中的sysstat-collect.timer/sysstat-collect.service/sa命令(没有配置文件)

分别相当于systemd-tmpfiles-clean.timer/systemd-tmpfiles-setup.service/systemd-tmpfiles --create      systemd-tmpfiles --remove (这个有配置文件
/usr/lib/tmpfiles.d/*.conf   /run/tmpfiles.d/*.conf/etc/tmpfiles.d/*.conf)


Description=Daily Cleanup of Temporary Directories
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)


OnBootSec=15min
OnUnitActiveSec=1d
~                     开机以后15分钟检查一次,以后每隔1天检查1次。
具体怎么删除:
/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
q /tmp 1777 root root 10d
q /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

# Remove top-level private temporary directories on each boot
R! /tmp/systemd-private-*
R! /var/tmp/systemd-private-*
~                                                                              
~                                                   
# man 5 tmpfiles.d











页: [1]
查看完整版本: 红帽7以后新的调度方法与临时文件删除机制