*** backup_migrate.module.old 2009-01-18 13:52:48.000000000 +1100 --- backup_migrate.module 2009-03-10 01:32:37.078125000 +1100 *************** *** 244,249 **** --- 244,254 ---- "#default_value" => variable_get("backup_migrate_nodata_tables", _backup_migrate_default_structure_only_tables()), "#description" => t("The selected tables will have their structure backed up but not their contents. This is useful for excluding cache data to reduce file size."), ); + $form['backup_migrate_basedir_name'] = array( + "#type" => "textfield", + "#title" => t("Backup base directory name"), + "#default_value" => variable_get("backup_migrate_basedir_name", ''), + ); $form['backup_migrate_file_name'] = array( "#type" => "textfield", "#title" => t("Backup file name"), *************** *** 323,328 **** --- 328,334 ---- 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_basedir_name", $form_values['backup_migrate_basedir_name']); 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']); *************** *** 891,896 **** --- 897,903 ---- if ($dir = _backup_migrate_check_destination_dir($mode)) { $filepath = $dir ."/". $filename; + chmod($temp_file, 0666); rename($temp_file, $filepath); $message = t('Database backup saved to %file. ', array('%file' => $filepath)); *************** *** 1034,1039 **** --- 1041,1050 ---- * Return the path on the server to save the dump files. */ function _backup_migrate_get_save_path($mode = "") { + + $basedir = variable_get("backup_migrate_basedir_name", ''); + if ($basedir) $dir = $basedir; + else $dir = file_directory_path() ."/backup_migrate"; if ($mode) { $dir .= $mode == "manual" ? "/manual" : "/scheduled";