# 进入目录
cd /path/to/mastodon

# 1. 清理 7 天远程媒体 + 头像
docker-compose run --rm web tootctl media remove --days 7 --prune-profiles

# 2. 清理 30 天预览卡片
docker-compose run --rm web tootctl preview_cards remove --days 30

# 3. 清理 14 天无互动站外嘟文
docker-compose run --rm web tootctl statuses remove --days 14

# 4. 清理失效远程账号
docker-compose run --rm web tootctl accounts cull

# 5. 清理孤立文件
docker-compose run --rm web tootctl media remove-orphans

设置定时清理任务

# 编辑定时任务
crontab -e

# 每天凌晨 2 点执行清理(示例)
0 2 * * * cd /path/to/mastodon && docker-compose run --rm web tootctl media remove --days 7
0 2 * * * cd /path/to/mastodon && docker-compose run --rm web tootctl preview_cards remove --days 30
0 3 * * * cd /path/to/mastodon && docker-compose run --rm web tootctl statuses remove --days 14
0 4 * * * cd /path/to/mastodon && docker-compose run --rm web tootctl accounts cull