From 51d39e5c807c1f7083ae80fbf8e68de692061c7b Mon Sep 17 00:00:00 2001 From: Will Budicm Date: Tue, 22 Dec 2020 08:10:11 +1100 Subject: [PATCH] Fix, pipe to backup file. --- htdocs/cgi-bin/config.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index 960fb5a..a7eeba1 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -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"; -- 2.34.1