Cookbooks
logrotate
documentation
Logrotate Global

logrotate_global

Back to resource list

This resource can be used to drop off customized logrotate config files on a per application basis.

The resource takes the following properties:

Properties

NameTypeDefaultDescription
config_fileString,'/etc/logrotate.conf'Specifies the path to the logrotate global config file.
template_nameStringlogrotate-global.erbSets the template source.
template_modeStringlogrotateThe mode to create the logrotate config file template.
template_ownerStringlogrotateThe owner of the logrotate config file template.
template_groupStringlogrotateThe group of the logrotate config file template.
optionsString, Array['weekly', 'datext']Logrotate global options.
includesString, Array[]Files or directories to include in the logrotate configuration.
parametersHash{}Logrotate global parameters.
pathHash{}Logrotate global path definitions.
scriptsHash{}Logrotate global options.

Examples

logrotate_global 'logrotate' do
  options %w(create weekly)
  parameters(
    'rotate' => 4
  )
  paths(
    '/var/log/wtmp' => {
      'missingok' => true,
      'monthly' => true,
      'create' => '0664 root utmp',
      'rotate' => 1,
    },
    '/var/log/btmp' => {
      'missingok' => true,
      'monthly' => true,
      'create' => '0600 root utmp',
      'rotate' => 1,
    }
  )
end

See the logrotate(8) manual page of v3.9.2 or earlier for the list of available options.