yicr
2/3/2020 - 1:00 AM

Linux : Tips / How to compress the log files automatically.

自動で古いログを圧縮する。

$ find /path/to/logs  -name "*.log" -mtime +15 -type f | xargs gzip

/path/to/logs 内の15日たったログファイルを圧縮。