Skip to content

Commit

Permalink
add logrotate for cpantesters home var/log
Browse files Browse the repository at this point in the history
  • Loading branch information
preaction committed Nov 30, 2017
1 parent db98b7b commit f3dac89
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Rexfile
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,19 @@ task prepare_user =>
PATH => '/home/cpantesters/perl5/bin:/opt/local/perlbrew/bin:/opt/local/perlbrew/perls/perl-5.24.0/bin:/usr/local/bin:/usr/bin:/bin',
MAILTO => '[email protected]',
};

Rex::Logger::info( 'Configuring logrotate' );
file '/etc/logrotate.d/cpantesters',
source => 'etc/logrotate-cpantesters.conf',
owner => 'root',
group => 'root',
mode => 644,
;
file '/home/cpantesters/var/log',
ensure => 'directory',
owner => 'cpantesters',
group => 'cpantesters',
;
};
};

Expand Down
1 change: 1 addition & 0 deletions etc/logrotate-cpan.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

daily
compress
minsize 10M
rotate 9
Expand Down
9 changes: 9 additions & 0 deletions etc/logrotate-cpantesters.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

daily
compress
minsize 10M
rotate 9
notifempty

/home/cpantesters/var/log/*.log { }
/home/cpantesters/var/log/*/*.log { }

0 comments on commit f3dac89

Please sign in to comment.