From 25127a8f58c7b30d65c8ca957918ec27a88e4f18 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Wed, 9 Sep 2020 16:51:17 +0300 Subject: [PATCH] Add proper file name upon backup, if undefined https://virtualmin.com/node/69843 --- backup-config/backup-config-lib.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backup-config/backup-config-lib.pl b/backup-config/backup-config-lib.pl index c8a69c89e..f89edfc3b 100755 --- a/backup-config/backup-config-lib.pl +++ b/backup-config/backup-config-lib.pl @@ -13,6 +13,7 @@ Functions for creating configuration file backups. Some example code : BEGIN { push(@INC, ".."); }; use strict; use warnings; +use POSIX; use WebminCore; our (%text, $module_config_directory, %config); &init_config(); @@ -299,7 +300,9 @@ if ($mode == 0) { $file = &date_subs($path); } else { - $file = &transname(); + my $fdate = strftime('%Y-%m-%d_%H-%M-%S', localtime()); + my $ext = &has_command("gzip") ? '.tar.gz' : '.tar'; + $file = &transname("backup_$fdate$ext"); } # Get module descriptions