2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

korrekt autoarchive

git-svn-id: https://svn.fhem.de/fhem/trunk@4850 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2014-02-08 18:27:06 +00:00
parent fa699cd58b
commit 0637d7fbdd

View File

@ -115,9 +115,12 @@ sub HMinfo_autoUpdate($){#in:name, send status-request
my $name = shift; my $name = shift;
(undef,$name)=split":",$name,2; (undef,$name)=split":",$name,2;
HMinfo_SetFn($defs{$name},$name,"update") if ($name); HMinfo_SetFn($defs{$name},$name,"update") if ($name);
# HMinfo_archConfig($defs{$name},$name,"","") if (AttrVal($name,"autoArchive",undef) &&
# if (AttrVal($name,"autoArchive",undef) && scalar(@{$modules{CUL_HM}{helper}{confUpdt}})){
# scalar(@{$modules{CUL_HM}{helper}{confUpdt}})); my $fN = AttrVal($name,"configFilename","regSave.cfg");
$fN = AttrVal($name,"configDir",".")."\/".$fN if ($fN !~ m/\//);
HMinfo_archConfig($defs{$name},$name,"",$fN);
}
InternalTimer(gettimeofday()+$defs{$name}{helper}{autoUpdate}, InternalTimer(gettimeofday()+$defs{$name}{helper}{autoUpdate},
"HMinfo_autoUpdate","sUpdt:".$name,0) "HMinfo_autoUpdate","sUpdt:".$name,0)
if (defined $defs{$name}{helper}{autoUpdate}); if (defined $defs{$name}{helper}{autoUpdate});
@ -905,9 +908,7 @@ sub HMinfo_SetFn($@) {#########################################################
} }
elsif($cmd eq "archConfig") {##action: archiveConfig------------------------- elsif($cmd eq "archConfig") {##action: archiveConfig-------------------------
# save config only if register are complete # save config only if register are complete
my $fn = $a[0]?$a[0]:AttrVal($name,"configFilename","regSave.cfg"); $ret = HMinfo_archConfig($hash,$name,$opt,($a[0]?$a[0]:""));
$fn = AttrVal($name,"configDir",".")."\/".$fn if ($fn !~ m/\//);
$ret = HMinfo_archConfig($hash,$name,$opt,$fn);
} }
else{ else{
my @cmdLst = my @cmdLst =
@ -1045,6 +1046,8 @@ sub HMinfo_saveConfig($) {#####################################################
sub HMinfo_archConfig($$$$) {################################################ sub HMinfo_archConfig($$$$) {################################################
# save config only if register are complete # save config only if register are complete
my ($hash,$name,$opt,$fN) = @_; my ($hash,$name,$opt,$fN) = @_;
$fN = $fN?$fN:AttrVal($name,"configFilename","regSave.cfg");
$fN = AttrVal($name,"configDir",".")."\/".$fN if ($fN !~ m/\//);
my $id = ++$hash->{nb}{cnt}; my $id = ++$hash->{nb}{cnt};
my $bl = BlockingCall("HMinfo_archConfigExec", join(",",("$name:$id" my $bl = BlockingCall("HMinfo_archConfigExec", join(",",("$name:$id"
,$fN ,$fN