| 1 |
<?php |
<?php |
| 2 |
// $Id: dba.module,v 1.44.2.12 2007/10/15 17:07:06 dww Exp $ |
// $Id: dba.module,v 1.44.2.13 2007/10/15 20:04:53 dww Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 329 |
} |
} |
| 330 |
|
|
| 331 |
function dba_auto_backup() { |
function dba_auto_backup() { |
| 332 |
|
$backup_started = time(); |
| 333 |
$path = variable_get('dba_auto_backup_path', file_directory_temp()); |
$path = variable_get('dba_auto_backup_path', file_directory_temp()); |
| 334 |
// See what tables (if any) the admin wants us to only backup |
// See what tables (if any) the admin wants us to only backup |
| 335 |
// the schema, not the actual data. we need it as an array, so we |
// the schema, not the actual data. we need it as an array, so we |
| 370 |
if ($fp = fopen($path ."/$filename", 'wb')) { |
if ($fp = fopen($path ."/$filename", 'wb')) { |
| 371 |
fwrite($fp, $backup); |
fwrite($fp, $backup); |
| 372 |
fclose($fp); |
fclose($fp); |
| 373 |
variable_set('dba_auto_backup_last', time()); |
variable_set('dba_auto_backup_last', $backup_started); |
| 374 |
|
|
| 375 |
// If enabled, email a copy of the backup to the site administrator. |
// If enabled, email a copy of the backup to the site administrator. |
| 376 |
if (variable_get('dba_auto_backup_mail', 0)) { |
if (variable_get('dba_auto_backup_mail', 0)) { |