Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
封存 Looker 記錄檔
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Looker 會每天自動輪替記錄檔。不過,一旦記錄輪替並加上日期戳記,Looker 就不會再執行任何壓縮或刪除記錄的動作。為節省客戶代管 Looker 執行個體的磁碟空間,建議您封存並刪除較舊的記錄檔案。
就最基本設定而言,建議您在 Looker 使用者的 crontab 中設定封存作業。新增下列 cron 項目,讓前 7 天的記錄檔保持未壓縮狀態,而 21 天前的記錄檔則以 gzip 格式儲存在記錄目錄中:
##zip Looker logs
9 1 * * * find $HOME/looker/log -name 'looker.log.????????' -mtime +7 -exec gzip '{}' \; > /dev/null
##delete Looker logs
33 1 * * * find $HOME/looker/log -name 'looker.log.????????.gz' -mtime +28 -exec rm -f '{}' \; > /dev/null
如要減少未壓縮的記錄,請將第一個項目中的 7 變更為較小的數字。如要儲存較少的壓縮記錄檔,請將第二個 crontab 項目中的 28 變更為較小的數字。
如要進一步瞭解如何使用 cron,請參閱 https://help.ubuntu.com/community/CronHowto。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-10-19 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-10-19 (世界標準時間)。"],[],[]]