mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 23:14:10 +00:00
backup: enable configDB / add Warning. Forum #23650
git-svn-id: https://svn.fhem.de/fhem/trunk@5893 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d668f4d43c
commit
a5df60c3f8
@ -49,12 +49,12 @@ CommandBackup($$)
|
||||
my ($cl, $param) = @_;
|
||||
|
||||
my $modpath = $attr{global}{modpath};
|
||||
my $configfile = (!defined($attr{global}{configfile}) ? undef : $attr{global}{configfile});
|
||||
my $statefile = (!defined($attr{global}{statefile}) ? undef : $attr{global}{statefile});
|
||||
my $configfile = AttrVal("global", "configfile", undef);
|
||||
my $statefile = AttrVal("global", "statefile", undef);
|
||||
my $msg;
|
||||
my $ret;
|
||||
|
||||
return "Backup is not supported for configDB" if(configDBUsed());
|
||||
Log 1, "NOTE: make sure you have a database backup!" if(configDBUsed());
|
||||
|
||||
# set backupdir
|
||||
my $backupdir;
|
||||
@ -81,12 +81,18 @@ CommandBackup($$)
|
||||
}
|
||||
}
|
||||
|
||||
# get pathnames to archiv
|
||||
push @pathname, $configfile;
|
||||
Log 4, "backup include: '$configfile'";
|
||||
$ret = parseConfig($configfile);
|
||||
push @pathname, $statefile;
|
||||
Log 4, "backup include: '$statefile'";
|
||||
if(configDBUsed()) {
|
||||
# add configDB configuration file
|
||||
push @pathname, 'configDB.conf';
|
||||
Log 4, "backup include: 'configDB.conf'";
|
||||
} else {
|
||||
# get pathnames to archiv
|
||||
push @pathname, $configfile;
|
||||
Log 4, "backup include: '$configfile'";
|
||||
$ret = parseConfig($configfile);
|
||||
push @pathname, $statefile;
|
||||
Log 4, "backup include: '$statefile'";
|
||||
}
|
||||
$ret = readModpath($modpath,$backupdir);
|
||||
|
||||
# create archiv
|
||||
|
@ -433,7 +433,7 @@ update_DoUpdate(@)
|
||||
|
||||
# do a backup first
|
||||
my $configfile = AttrVal("global", "configfile", "");
|
||||
my $doBackup = AttrVal("global", "backup_before_update", !configDBUsed());
|
||||
my $doBackup = AttrVal("global", "backup_before_update", 1);
|
||||
|
||||
if ($doBackup) {
|
||||
my $cmdret = AnalyzeCommand(undef, "backup");
|
||||
|
Loading…
x
Reference in New Issue
Block a user