Commit 123fac74 authored by Romain Courteaud's avatar Romain Courteaud

Put all configurations in logrotate included file.

"It seems" that logrotate does not allow to put those parameters in
logrotate.conf
parent 39733477
...@@ -36,18 +36,10 @@ class Recipe(GenericBaseRecipe): ...@@ -36,18 +36,10 @@ class Recipe(GenericBaseRecipe):
logrotate_conf_file = self.options['conf'] logrotate_conf_file = self.options['conf']
logrotate_conf = [ logrotate_conf = [
'daily',
'dateext',
'rotate 3650',
'compress',
'compresscmd %s' % self.options['gzip-binary'], 'compresscmd %s' % self.options['gzip-binary'],
'compressoptions -9', 'compressoptions -9',
'uncompresscmd %s' % self.options['gunzip-binary'], 'uncompresscmd %s' % self.options['gunzip-binary'],
'notifempty',
'sharedscripts',
'create',
'include %s' % logrotate_d, 'include %s' % logrotate_d,
'olddir %s' % logrotate_backup,
] ]
logrotate_conf_file = self.createFile(logrotate_conf_file, logrotate_conf_file = self.createFile(logrotate_conf_file,
...@@ -69,7 +61,16 @@ class Part(GenericBaseRecipe): ...@@ -69,7 +61,16 @@ class Part(GenericBaseRecipe):
logrotate_d = self.options['logrotate-entries'] logrotate_d = self.options['logrotate-entries']
conf = [] conf = [
'daily',
'dateext',
'rotate 3650',
'compress',
'notifempty',
'sharedscripts',
'create',
'olddir %s' % logrotate_backup,
]
if 'post' in self.options: if 'post' in self.options:
conf.append("postrotate\n%s\nendscript" % self.options['post']) conf.append("postrotate\n%s\nendscript" % self.options['post'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment