Linux Logrotate 設定ファイル生成ツール(ログローテーション&圧縮)
日次・週次ローテーション、gzip圧縮、dateext、ファイルサイズ制限、postrotateスクリプトを含む本番環境用 /etc/logrotate.d/ 設定ファイルを安全に生成。
/var/log/nginx/*.log {
daily
rotate 14
maxage 30
missingok
notifempty
compress
delaycompress
dateext
dateformat -%Y%m%d
dateyesterday
create 0640 www-data adm
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 $(cat /var/run/nginx.pid)
endscript
}自動削除されるまで指定世代数のログを保持します。
Estimated ~85% disk storage savings with background gzip.
Atomic file rotation with new file recreation and custom permissions.
100% クライアントサイド完結
サーバーへのデータ送信は一切ありません。ログパスやカスタムスクリプトはブラウザ内部でのみ安全に処理されます。
Logrotate仕様に完全準拠
copytruncate、delaycompress、dateext、サイズ制限、sharedscripts、su権限分離など主要ディレクティブを完全サポート。
本番導入に直結する成果物
logrotate.d設定ファイルに加えて、logrotate -dドライラン構文検証コマンドや自動セットアップスクリプトを瞬時に出力。