Skip to content

Instantly share code, notes, and snippets.

@hoangtranwork
Forked from ledongthuc/centos_logrotate
Created March 7, 2019 08:06
Show Gist options
  • Select an option

  • Save hoangtranwork/4f915f90e336b2e5b56426c13d7153f4 to your computer and use it in GitHub Desktop.

Select an option

Save hoangtranwork/4f915f90e336b2e5b56426c13d7153f4 to your computer and use it in GitHub Desktop.

Revisions

  1. @ledongthuc ledongthuc created this gist Sep 7, 2018.
    41 changes: 41 additions & 0 deletions centos_logrotate
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    sudo bash -c "cat <<EOT > /etc/logrotate.d/api
    /opt/app/*.log {
    missingok
    notifempty
    compress
    size 10k
    daily
    copytruncate
    compress
    sharedscripts
    rotate 1
    maxage 1
    create 0644 <username> <groupname>
    }
    /opt/app/jackrabbit.log_IS_UNDEFINED {
    missingok
    notifempty
    compress
    size 10k
    daily
    copytruncate
    compress
    sharedscripts
    rotate 1
    maxage 1
    create 0644 <username> <groupname>
    }
    jetty.log_IS_UNDEFINED {
    missingok
    notifempty
    compress
    size 10k
    daily
    copytruncate
    compress
    sharedscripts
    rotate 1
    maxage 1
    create 0644 <username> <groupname>
    }
    EOT"