]> git.proxmox.com Git - pmg-api.git/commitdiff
PMG/DBTools.pm - use user root to sync database
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Dec 2017 06:51:15 +0000 (07:51 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Dec 2017 06:51:15 +0000 (07:51 +0100)
PMG/DBTools.pm

index fc982e542c9366a4d5373a9e79163ebffae93bf1..0af96b53708be665a7338648e4ec8b7667399ce7 100644 (file)
@@ -1092,12 +1092,11 @@ sub init_nodedb {
 
        open (my $fh, ">", $fn) || die "open '$fn' failed - $!\n";
 
-       postgres_admin_cmd(
-           ['/usr/bin/ssh', '-o', 'BatchMode=yes',
-            '-o', "HostKeyAlias=${master_name}",
-            $master_ip, 'pg_dump'],
-           { output => '>&' . fileno($fh) },
-           $dbname, '-F', 'c');
+       my $cmd = ['/usr/bin/ssh', '-o', 'BatchMode=yes',
+                  '-o', "HostKeyAlias=${master_name}", $master_ip,
+                  'pg_dump', $dbname, '-F', 'c' ];
+
+       PVE::Tools::run_command($cmd, output => '>&' . fileno($fh));
 
        close($fh);