Skip to content
Snippets Groups Projects
Commit ab3ac58a authored by Monika Komorowska's avatar Monika Komorowska
Browse files

Fixed dump out option.

parent 0b006002
No related branches found
No related tags found
No related merge requests found
......@@ -205,13 +205,17 @@ my %data;
if ($dumpout) {
my $file_path = $dumpout . "/" . $dbname . $table .'.sql';
my $file_path = $dumpout . "/" . $dbname . $table .'_bak.sql';
open(BKUPFILE, ">$file_path") or die("Can't write to file $file_path\n");
my $cmd = "mysqldump -h $host -u $user -p$pass $dbname $table";
my $result = `$cmd`;
print BKUPFILE $result;
close BKUPFILE;
if ($result !~ /Dump completed/) { print("back up failed, check file $file_path for details\n");}
if ($result !~ /Dump completed/) {
print("back up failed, check file $file_path for details\n");
} else {
print("$full_table_name_bak dumped out to file $file_path\n");
}
next;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment