CentOS 清理无用文件步骤
一 准备与风险
二 标准清理流程
三 定位大文件与目录
四 自动化与维护
#!/bin/bash
systemd-tmpfiles --clean
find /tmp -type f -mtime +7 -delete
find /var/tmp -type f -mtime +7 -delete
yum clean all 2>/dev/null || dnf clean all 2>/dev/null
journalctl --vacuum-time=30d
logrotate -f /etc/logrotate.conf
0 2 * * * /usr/local/bin/cleanup.sh >> /var/log/cleanup.log 2>&1