Skip to content

Instantly share code, notes, and snippets.

@pantoniotti
Created May 2, 2014 16:41
Show Gist options
  • Save pantoniotti/668f897ad5b92e1f7d43 to your computer and use it in GitHub Desktop.
Save pantoniotti/668f897ad5b92e1f7d43 to your computer and use it in GitHub Desktop.
LogRotate setup on Ubuntu
Ubuntu LogRotate Install and Setup
# 1-Check updates
sudo apt-get update
# 2—Install Logrotate
sudo apt-get install logrotate
# 3 — Confirmation
# To verify that logrotate was successfully installed, run this in the command prompt.
logrotate
# Since the logrotate utility is based on configuration files, the above command will
# not rotate any files and will show you a brief overview of the usage and the switch
# options available.
# 4—Configure Logrotate
# Configurations and default options for the logrotate utility are present in:
/etc/logrotate.conf
# Some of the important configuration settings are : rotation-interval, log-file-size, rotation-count and compression.
# Application-specific log file information (to override the defaults) are kept at: /etc/logrotate.d/
# 5—Example
# Debian package management system example : /etc/logrotate.d/dpkg
# /var/log/dpkg.log {
# monthly
# rotate 12
# compress
# delaycompress
# missingok
# notifempty
# create 644 root root
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment