]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Fix, pipe to backup file.
authorWill Budicm <redacted>
Mon, 21 Dec 2020 21:10:11 +0000 (08:10 +1100)
committerWill Budicm <redacted>
Mon, 21 Dec 2020 21:10:11 +0000 (08:10 +1100)
htdocs/cgi-bin/config.cgi

index 960fb5a6261ca6f6e683b36a203e00c4aed7fcf0..a7eeba13a72245885addae5f492be2fab4f40fb8 100755 (executable)
@@ -1051,7 +1051,7 @@ sub restore {
         my $dbck = &Settings::logPath."bck/"; `mkdir $dbck` if (!-d $dbck);
         my $tar = $dbck.$hndl; $tar =~ s/osz$/tar/;
         my $pipe;
-        open ($pipe, "|" ,"openssl enc -d -des-ede3-cfb -salt -S ".Settings->CIPHER_KEY." -pass pass:$pass-$alias -in /dev/stdin 2>/dev/null > $tar");
+        open ($pipe, "| openssl enc -d -des-ede3-cfb -salt -S ".Settings->CIPHER_KEY." -pass pass:$pass-$alias -in /dev/stdin 2>/dev/null > $tar");
             while(<$hndl>){print $pipe $_;};
         close $pipe;
 
@@ -1066,7 +1066,7 @@ sub restore {
         $cmd = `tar xzvf $tar -C $dbck --strip-components 1 2>/dev/null` or die "Failed extracting $tar";
         print "Extracted->\n".$cmd."\n" or die "Failed extracting $tar";;
 
-        my $b_base = $dbck.$dbname;
+        my $b_base = $dbck.'data_'.$dbname.'_log.db'; 
         my $dsn= "DBI:SQLite:dbname=$b_base";
         my $b_db = DBI->connect($dsn, $alias, $pass, { RaiseError => 1 }) or LifeLogException->throw(error=>"Invalid database! $dsn->$hndl [$@]", show_trace=>&Settings::debug);
         print "Connected to -> $dsn\n";