be168e51b6
Etherpad Lite does not give up its log files sanely. Instead according to their bug tracker one should use logrotate's copytruncate option. So we will use copytruncate. Change-Id: Ic76d215bf35f3aa64ca5764512debb5cdcfca60e
27 lines
697 B
Puppet
27 lines
697 B
Puppet
class etherpad_lite::backup (
|
|
$minute = '0',
|
|
$hour = '0',
|
|
$day = '*',
|
|
$dest = "${etherpad_lite::base_log_dir}/${etherpad_lite::ep_user}/db.sql.gz",
|
|
$rotation = 'daily',
|
|
$num_backups = '30'
|
|
) {
|
|
|
|
cron { eplitedbbackup:
|
|
ensure => present,
|
|
command => "/usr/bin/mysqldump --defaults-file=/etc/mysql/debian.cnf --opt etherpad-lite | gzip -9 > ${dest}",
|
|
minute => $minute,
|
|
hour => $hour,
|
|
weekday => $day,
|
|
require => Package['mysql-server']
|
|
}
|
|
|
|
include logrotate
|
|
logrotate::file { 'eplitedb':
|
|
log => $dest,
|
|
options => ['nocompress', "rotate ${num_backups}", $rotation],
|
|
require => Cron['eplitedbbackup']
|
|
}
|
|
|
|
}
|