logrotated

home > recipes > logrotated

Tasks

Task documentation

logrotated:force

Force rotate files.

Source

Parameters

logrotate_bin_path
Logrotate bin path
Defaults to "logrotate"
Example: set :logrotate_bin_path, /usr/local/bin/logrotate
logrotate_conf_path
Path to logrotate conf
Defaults to "/etc/logrotate.conf"

logrotated:install_conf

Create logrotated conf. You probably use this in other recipes and not standalone.

Source

Parameters

logrotate_name
Name of file in /etc/logrotate.d/
logrotate_log_path
Path to log file. Can include wildcards, like /var/log/foo_*.log.
logrotate_options
Log rotate options
  • :rotate (Number of times to rotate before discarding)
  • :size (Rotate when file hits this size)
  • :daily, :weekly, :monthly (How often to perform rotate)
  • :missingok
  • :compress
  • :delaycompress
  • :notifempty
  • :copytruncate

See man page for all the options.


set :logrotate_options, [ { :rotate => 7, :size => 10MB }, 
    :daily, :missingok, :compress, :delaycompress, :notifempty, :copytruncate ]

ducktyper.com, 14th May 2008
Theme extended from Paul Battley