初始提交:DSH 多租户平台(dshs)
This commit is contained in:
commit
43976fea6a
167 files changed
+24456
No files matched your search
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# purge-trash.sh —— 清理各用户 trash/ 下超过 30 天的回收目录(档案 28)
|
||||
# 回收站是"清理动作的缓冲区":脚本只做 mv 进来,只有本脚本才真正 rm。
|
||||
set -uo pipefail
|
||||
KEEP_DAYS="${1:-30}"
|
||||
LOG=/var/log/dsh-trash-purge.log
|
||||
echo "[$(date -Is)] purge trash older than ${KEEP_DAYS}d" >> "$LOG"
|
||||
for t in /var/lib/dshs/users/*/trash; do
|
||||
[ -d "$t" ] || continue
|
||||
find "$t" -mindepth 1 -maxdepth 1 -mtime "+${KEEP_DAYS}" -print -exec rm -rf {} + >> "$LOG" 2>&1
|
||||
done
|
||||
echo "[$(date -Is)] done" >> "$LOG"
|
||||
Reference in new issue
Block a user