2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-29 11:27:08 +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:
rudolfkoenig 2014-05-19 09:45:08 +00:00
parent d668f4d43c
commit a5df60c3f8
2 changed files with 16 additions and 10 deletions

View File

@ -49,12 +49,12 @@ CommandBackup($$)
my ($cl, $param) = @_; my ($cl, $param) = @_;
my $modpath = $attr{global}{modpath}; my $modpath = $attr{global}{modpath};
my $configfile = (!defined($attr{global}{configfile}) ? undef : $attr{global}{configfile}); my $configfile = AttrVal("global", "configfile", undef);
my $statefile = (!defined($attr{global}{statefile}) ? undef : $attr{global}{statefile}); my $statefile = AttrVal("global", "statefile", undef);
my $msg; my $msg;
my $ret; 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 # set backupdir
my $backupdir; my $backupdir;
@ -81,12 +81,18 @@ CommandBackup($$)
} }
} }
# get pathnames to archiv if(configDBUsed()) {
push @pathname, $configfile; # add configDB configuration file
Log 4, "backup include: '$configfile'"; push @pathname, 'configDB.conf';
$ret = parseConfig($configfile); Log 4, "backup include: 'configDB.conf'";
push @pathname, $statefile; } else {
Log 4, "backup include: '$statefile'"; # 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); $ret = readModpath($modpath,$backupdir);
# create archiv # create archiv

View File

@ -433,7 +433,7 @@ update_DoUpdate(@)
# do a backup first # do a backup first
my $configfile = AttrVal("global", "configfile", ""); my $configfile = AttrVal("global", "configfile", "");
my $doBackup = AttrVal("global", "backup_before_update", !configDBUsed()); my $doBackup = AttrVal("global", "backup_before_update", 1);
if ($doBackup) { if ($doBackup) {
my $cmdret = AnalyzeCommand(undef, "backup"); my $cmdret = AnalyzeCommand(undef, "backup");