在 CentOS 中,常说的 “recycle(回收站)” 通常有两种情况,调整“容量”的方式也不同。下面分别说明:
如果你是在 Samba 共享中启用了 recycle 模块(类似 Windows 回收站):
vi /etc/samba/smb.conf
示例配置:
[share]
path = /data/share
read only = no
recycle:repository = .recycle
recycle:keeptree = yes
recycle:maxsize = 0
Samba 的 recycle 没有“总容量”限制,但可以通过以下参数控制:
recycle:maxsize = 104857600 # 100MB
超过该大小的文件不会被放入回收站
recycle:touch = yes
recycle:touch_mtime = yes
配合 tmpwatch 或 cron 定期清理
# 删除 7 天前的回收站文件
find /data/share/.recycle -type f -mtime +7 -delete
✅ Samba 回收站容量 = 磁盘剩余空间 + 清理策略
有时用户把 LVM 的 快照(snapshot) 叫 recycle:
lvs
lvresize -L 10G /dev/vg00/snap01
CentOS 带桌面的话:
~/.local/share/Trashrm -rf ~/.local/share/Trash/*
如果是为了防止回收站占满磁盘:
cron 定时清理df -h
如果你能告诉我:
我可以给你精确配置示例。