# 檔案清理

隨著時間推移，Chamilo 會在其快取和封存目錄中累積臨時檔案。定期清理可防止磁碟空間問題。

## 可清理的項目

* **Symfony cache** — 編譯的範本、快取的設定和路由資料
* **Temporary files** — 匯出、匯入及其他作業期間產生的檔案
* **Session data** — 已過期的 PHP 工作階段檔案
* **Log files** — 不再需要的舊日誌檔案

## 執行清理

### 從管理面板

在管理面板中導航至 **Archive cleanup**。點擊清理按鈕以移除臨時檔案。

### 從命令列

如需更多控制，請使用 Symfony console 指令：

```bash
# Clear the Symfony cache
php bin/console cache:clear

# Clear only the production cache
php bin/console cache:clear --env=prod
```

## 提示

* **Schedule regular cleanups** — 設定每週或每月 cron 工作來清除臨時檔案
* **Monitor disk usage** — 留意 `var/` 目錄的大小，因為它會隨著快取和日誌檔案而增長
* **Be careful with logs** — 在刪除日誌檔案前，檢查它們是否包含您可能用於疑難排解的資訊


---

# 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-tw/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.
