Topic: Renaming Backup File Feature Mod
I have just made a modification of the admin/backups.php file to allow for renaming of backup files to .sql or .gz files after stripping all spaces (and periods for other extensions, forcing an .sql.gz extension for such ones).
@joe: you can include it in the core.
--- old/admin/backups.php Sat Dec 20 14:35:56 2014
+++ new/admin/backups.php Sat Dec 20 15:43:18 2014
@@ -142,6 +142,26 @@
display_error(_("Select backup file first."));
}
+if (get_post('rendump')) {
+ if ($backup_name) {
+ $rename_file = str_replace(" ", "", trim(get_post('comments')));
+ if (strlen($rename_file) > 0) {
+
+ $file_extn = pathinfo($rename_file, PATHINFO_EXTENSION);
+ if (!in_array($file_extn, Array("sql","gz")))
+ $rename_file = str_replace(".", "", $rename_file) . '.sql.gz';
+ $rename_path = BACKUP_PATH . $rename_file;
+
+ if (rename($backup_path, $rename_path)) {
+ display_notification($backup_name . " : " . _("File successfully renamed.")." "
+ . _("New Filename") . ": " . $rename_path);
+ $Ajax->activate('backups');
+ } else display_error(_("Can't rename backup file."));
+
+ } else display_error($rename_file . " : " . _("Enter valid new file name to rename backup file."));
+ } else display_error(_("Select backup file first."));
+}
+
if (get_post('deldump')) {
if ($backup_name) {
if (unlink($backup_path)) {
@@ -191,6 +211,8 @@
start_table();
submit_row('view',_("View Backup"), false, '', '', false);
submit_row('download',_("Download Backup"), false, '', '', false);
+ submit_row('rendump',_("Rename Backup"), false, '','', 'process');
+ submit_js_confirm('rendump',_("You are about to rename database backup file.\nDo you want to continue?"));
submit_row('restore',_("Restore Backup"), false, '','', 'process');
submit_js_confirm('restore',_("You are about to restore database from backup file.\nDo you want to continue?"));
Pushed to my github repo till inclusion into core.