2013-01-02 17:13:45 +01:00
|
|
|
# optimize mysql databases regurarely
|
2014-03-07 00:38:20 +01:00
|
|
|
class mysql::server::cron::optimize (
|
|
|
|
$optimize_hour,
|
|
|
|
$optimize_minute,
|
|
|
|
$optimize_day
|
|
|
|
) {
|
2009-12-10 20:52:50 +01:00
|
|
|
|
2013-01-02 17:13:45 +01:00
|
|
|
file { 'mysql_optimize_script':
|
|
|
|
path => '/usr/local/sbin/optimize_mysql_tables.rb',
|
|
|
|
source => 'puppet:///modules/mysql/scripts/optimize_tables.rb',
|
|
|
|
owner => root,
|
|
|
|
group => 0,
|
|
|
|
mode => '0700';
|
|
|
|
}
|
2009-12-10 20:52:50 +01:00
|
|
|
|
2013-01-02 17:13:45 +01:00
|
|
|
cron { 'mysql_optimize_cron':
|
|
|
|
command => '/usr/local/sbin/optimize_mysql_tables.rb',
|
|
|
|
user => 'root',
|
2014-03-07 00:38:20 +01:00
|
|
|
minute => $optimize_minute,
|
|
|
|
hour => $optimize_hour,
|
|
|
|
weekday => $optimize_day,
|
2013-01-02 17:13:45 +01:00
|
|
|
require => [ Exec['mysql_set_rootpw'],
|
|
|
|
File['mysql_root_cnf'],
|
|
|
|
File['mysql_optimize_script'] ],
|
|
|
|
}
|
2009-12-10 20:52:50 +01:00
|
|
|
}
|