| 1 |
<?php |
<?php |
| 2 |
// $Id: db_maintenance.module,v 1.11.2.2 2008/05/28 18:57:38 deekayen Exp $ |
// $Id: db_maintenance.module,v 1.11.2.2.2.1 2008/10/01 05:05:30 jgraham Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 121 |
} |
} |
| 122 |
|
|
| 123 |
$last_db_backup = variable_get('db_maintenance_last_db_backup', 0); |
$last_db_backup = variable_get('db_maintenance_last_db_backup', 0); |
| 124 |
$db_backup_freq = variable_get('db_maintenance_db_backup_frequency', 0); |
$db_backup_freq = variable_get('db_maintenance_db_backup_frequency', -1); |
| 125 |
$files_backup_freq = variable_get('db_maintenance_files_backup_frequency', 0); |
$files_backup_freq = variable_get('db_maintenance_files_backup_frequency', -1); |
| 126 |
$last_files_backup = variable_get('db_maintenance_last_files_backup', 0); |
$last_files_backup = variable_get('db_maintenance_last_files_backup', 0); |
| 127 |
|
|
| 128 |
if ($db_backup_freq != -1 && $last_db_backup <= $now - $db_backup_freq) { |
if ($db_backup_freq != -1 && $last_db_backup <= $now - $db_backup_freq) { |
| 217 |
'#description' => t('If enabled and a table receives a non-okay status from the OPTIMIZE then a repair of that table will be attempted. In the case of REPAIR all resulting status are logged via watchdog.') |
'#description' => t('If enabled and a table receives a non-okay status from the OPTIMIZE then a repair of that table will be attempted. In the case of REPAIR all resulting status are logged via watchdog.') |
| 218 |
); |
); |
| 219 |
|
|
| 220 |
$options = array( |
$frequency = array( |
| 221 |
-1 => t('Never'), |
-1 => t('Never'), |
| 222 |
0 => t('Run during every cron'), |
0 => t('Run during every cron'), |
| 223 |
3600 => t('Hourly'), |
3600 => t('Hourly'), |
| 232 |
$form['db_maintenance_cron_frequency'] = array( |
$form['db_maintenance_cron_frequency'] = array( |
| 233 |
'#type' => 'select', |
'#type' => 'select', |
| 234 |
'#title' => t('Optimize tables'), |
'#title' => t('Optimize tables'), |
| 235 |
'#options' => $options, |
'#options' => $frequency, |
| 236 |
'#default_value' => variable_get('db_maintenance_cron_frequency', 86400), |
'#default_value' => variable_get('db_maintenance_cron_frequency', 86400), |
| 237 |
'#description' => t('Select how often database tables should be optimized.') .' '. l(t('Optimize now.'), 'db_maintenance/optimize'), |
'#description' => t('Select how often database tables should be optimized.') .' '. l(t('Optimize now.'), 'db_maintenance/optimize'), |
| 238 |
); |
); |
| 264 |
'#title' => t('Database Backup frequency'), |
'#title' => t('Database Backup frequency'), |
| 265 |
'#description' => t('How often to backup the database. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'), |
'#description' => t('How often to backup the database. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'), |
| 266 |
'#options' => $frequency, |
'#options' => $frequency, |
| 267 |
'#default_value' => variable_get('db_maintenance_db_backup_frequency', 0), |
'#default_value' => variable_get('db_maintenance_db_backup_frequency', -1), |
| 268 |
); |
); |
| 269 |
|
|
| 270 |
$form['db_maintenance_files_backup_frequency'] = array( |
$form['db_maintenance_files_backup_frequency'] = array( |
| 272 |
'#title' => t('Files Backup frequency'), |
'#title' => t('Files Backup frequency'), |
| 273 |
'#description' => t('How often to backup the files directory. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'), |
'#description' => t('How often to backup the files directory. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'), |
| 274 |
'#options' => $frequency, |
'#options' => $frequency, |
| 275 |
'#default_value' => variable_get('db_maintenance_files_backup_frequency', 0), |
'#default_value' => variable_get('db_maintenance_files_backup_frequency', -1), |
| 276 |
); |
); |
| 277 |
|
|
| 278 |
$form['db_maintenance_backup_directory'] = array( |
$form['db_maintenance_backup_directory'] = array( |