# 归档清理

随着时间的推移，Chamilo 会在其缓存和归档目录中积累临时文件。定期清理可以防止磁盘空间问题。

## 可以清理的内容

* **Symfony 缓存** — 编译后的模板、缓存的配置和路由数据
* **临时文件** — 在导出、导入和其他操作期间生成的文件
* **会话数据** — 已过期的 PHP 会话文件
* **日志文件** — 不再需要的旧日志文件

## 执行清理

### 通过管理面板

在管理面板中导航到 **归档清理**。点击清理按钮以删除临时文件。

### 通过命令行

为了获得更多控制，可以使用 Symfony 控制台命令：

```bash
# 清除 Symfony 缓存
php bin/console cache:clear

# 仅清除生产环境缓存
php bin/console cache:clear --env=prod
```

## 小贴士

* **安排定期清理** — 设置每周或每月的 cron 任务来清除临时文件
* **监控磁盘使用情况** — 关注 `var/` 目录的大小，因为它会随着缓存和日志文件的增加而增长
* **谨慎处理日志** — 在删除日志文件之前，检查它们是否包含可能用于故障排除的信息


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chamilo.org/2.x-zh-cn/guan-li-zhi-nan/admin-guide/maintenance/archive-cleanup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
