Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Looker otomatis memutar file log setiap hari. Namun, setelah log dirotasi dan diberi stempel tanggal, Looker tidak melakukan tindakan lebih lanjut untuk mengompresi atau menghapus log. Untuk menghemat ruang disk di instance Looker yang dihosting pelanggan, sebaiknya Anda mengarsipkan dan menghapus file log lama.
Untuk konfigurasi paling dasar, sebaiknya siapkan tugas pengarsipan di crontab pengguna Looker. Tambahkan entri cron berikut agar file log 7 hari sebelumnya tidak dikompresi dan file log 21 hari sebelumnya di-gzip di direktori log Anda:
Untuk membuat log yang tidak dikompresi lebih sedikit, ubah 7 di entri pertama menjadi angka yang lebih rendah. Untuk menyimpan lebih sedikit log yang dikompresi, ubah 28 di entri crontab kedua menjadi angka yang lebih rendah.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-31 UTC."],[],[],null,["# Archiving Looker log files\n\nLooker automatically rotates [log files](/looker/docs/creating-backups#directory_structure) daily. However, once the log is rotated and date stamped, Looker does not perform any further actions to compress or delete the logs. To preserve disk space on a customer-hosted Looker instance, we recommend you archive and delete older log files.\n\nFor the most basic configuration, we recommend setting up archive jobs in the Looker user's crontab. Add the following `cron` entries to leave the previous 7 days of log files uncompressed and the 21 days of log files prior to that gzipped in your log directory: \n\n ##zip Looker logs\n 9 1 * * * find $HOME/looker/log -name 'looker.log.????????' -mtime +7 -exec gzip '{}' \\; \u003e /dev/null\n ##delete Looker logs\n 33 1 * * * find $HOME/looker/log -name 'looker.log.????????.gz' -mtime +28 -exec rm -f '{}' \\; \u003e /dev/null\n\nTo leave fewer uncompressed logs, change the `7` in the first entry to a lower number. To store fewer compressed logs, change the `28` in the second crontab entry to a lower number.\n\nFor more information on how to use `cron`, see \u003chttps://help.ubuntu.com/community/CronHowto\u003e."]]