差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 | |||
tech:tinyproxy [2024/09/26 16:26] – [使用 docker compose 方式] jonathan | tech:tinyproxy [2024/09/26 17:53] (目前版本) – 加上常見問題 jonathan | ||
---|---|---|---|
行 73: | 行 73: | ||
: | : | ||
</ | </ | ||
+ | |||
+ | ===== 常見問題 ===== | ||
+ | * Q:如何讓 log 檔只保留一段時間就好 Exp. 一年 | ||
+ | * A: 在 host 安裝 logrotate 來進行處理 | ||
+ | - 安裝 logrotate < | ||
+ | - 編輯 / | ||
+ | / | ||
+ | daily | ||
+ | rotate 365 | ||
+ | compress | ||
+ | delaycompress | ||
+ | missingok | ||
+ | notifempty | ||
+ | create 644 root root | ||
+ | postrotate | ||
+ | docker exec tinyproxy kill -HUP $(docker exec tinyproxy cat / | ||
+ | endscript | ||
+ | } | ||
+ | </ | ||
+ | - 驗證執行 < | ||
+ | * ++看結果|< | ||
+ | tinyproxy-235: | ||
+ | warning: logrotate in debug mode does nothing except printing debug messages! | ||
+ | |||
+ | reading config file / | ||
+ | Reading state from file: / | ||
+ | state file / | ||
+ | Allocating hash table for state file, size 64 entries | ||
+ | |||
+ | Handling 1 logs | ||
+ | |||
+ | rotating pattern: / | ||
+ | empty log files are not rotated, old logs are removed | ||
+ | considering log / | ||
+ | Creating new state | ||
+ | Now: 2024-09-26 17:52 | ||
+ | Last rotated at 2024-09-26 17:00 | ||
+ | log does not need rotating (log has already been rotated) | ||
+ | </ | ||
+ | |||
===== 相關參考資料 ===== | ===== 相關參考資料 ===== |