You are here

function backup_migrate_backup_submit in Backup and Migrate 5

Same name and namespace in other branches
  1. 6 backup_migrate.module \backup_migrate_backup_submit()

Submit the form. Save the values as defaults if desired and output the backup file.

File

./backup_migrate.module, line 327
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)

Code

function backup_migrate_backup_submit($form_id, $form_values) {
  if ($form_values['backup_migrate_save_settings']) {
    variable_set("backup_migrate_exclude_tables", $form_values['backup_migrate_exclude_tables']);
    variable_set("backup_migrate_nodata_tables", $form_values['backup_migrate_nodata_tables']);
    variable_set("backup_migrate_file_name", $form_values['backup_migrate_file_name']);
    variable_set("backup_migrate_destination", $form_values['backup_migrate_destination']);
    variable_set("backup_migrate_compression", $form_values['backup_migrate_compression']);
    variable_set("backup_migrate_append_timestamp", $form_values['backup_migrate_append_timestamp']);
    variable_set("backup_migrate_timestamp_format", $form_values['backup_migrate_timestamp_format']);
  }
  _backup_migrate_dump_tables($form_values['backup_migrate_file_name'], $form_values['backup_migrate_exclude_tables'], $form_values['backup_migrate_nodata_tables'], 'sql', $form_values['backup_migrate_destination'], $form_values['backup_migrate_compression'], "manual", $form_values['backup_migrate_append_timestamp'] ? $form_values['backup_migrate_timestamp_format'] : false);
  return "admin/content/backup_migrate";
}