mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add proper file name upon backup, if undefined
https://virtualmin.com/node/69843
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user