*** backup_migrate.module.old 2009-01-18 13:53:16.000000000 +1100 --- backup_migrate.module 2009-03-09 22:14:39.187500000 +1100 *************** *** 222,227 **** --- 222,234 ---- "#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"), *************** *** 301,306 **** --- 308,314 ---- if ($form_state['values']['backup_migrate_save_settings']) { variable_set("backup_migrate_exclude_tables", $form_state['values']['backup_migrate_exclude_tables']); variable_set("backup_migrate_nodata_tables", $form_state['values']['backup_migrate_nodata_tables']); + variable_set("backup_migrate_basedir_name", $form_state['values']['backup_migrate_basedir_name']); variable_set("backup_migrate_file_name", $form_state['values']['backup_migrate_file_name']); variable_set("backup_migrate_destination", $form_state['values']['backup_migrate_destination']); variable_set("backup_migrate_compression", $form_state['values']['backup_migrate_compression']); *************** *** 870,875 **** --- 878,884 ---- 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)); *************** *** 1013,1018 **** --- 1022,1031 ---- * 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";