Skip to content

Instantly share code, notes, and snippets.

@vishaltelangre
Last active May 15, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishaltelangre/a956c02ed5145489062f to your computer and use it in GitHub Desktop.
Save vishaltelangre/a956c02ed5145489062f to your computer and use it in GitHub Desktop.
logrotate
  • Create /etc/logrotate.d/my-crazy-app file with following snippet:
/var/log/my-crazy-app/*.log {
        daily
        size 500M
        missingok
        rotate 10
        compress
        delaycompress
        notifempty
        create 664 deploy devops
}
  • Activate it as:
sudo logrotate -f /etc/logrotate.d/my-crazy-app
  • Cross Verify here:
less /var/lib/logrotate/status
  • RTFM man logrotate for more info!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment