Doe not restore database if table check fails
This commit is contained in:
parent
62d8e69d19
commit
e7596c6ec7
6
mysql.cf
6
mysql.cf
|
@ -240,7 +240,7 @@ vars:
|
|||
|
||||
"classname" string => "mysql_$(dbdef[db_name])_$(table_name)_exists";
|
||||
|
||||
"cmd" string => 'if mysql $(xargs) -e "show tables LIKE \'$(table_name)\'" $(dbdef[db_name]) | grep -q \'$(table_name)\'; then echo "+$(classname)"; else echo "-$(classname)"; fi';
|
||||
"cmd" string => 'mysql $(xargs) -e "show tables LIKE \'$(table_name)\'" $(dbdef[db_name]) > /tmp/$(dbdef[db_name]).check && if grep -q \'$(table_name)\' /tmp/$(dbdef[db_name]).check ; then echo "+$(classname)"; else echo "-$(classname)"; fi';
|
||||
|
||||
commands:
|
||||
"$(cmd)"
|
||||
|
@ -444,6 +444,10 @@ methods:
|
|||
"any" usebundle => restore_mysql_db(@(cfg),"$(file)"),
|
||||
depends_on=>{"$(table_exists)_checked"};
|
||||
reports:
|
||||
#"!$(table_exists)&backup_exists"::
|
||||
# "DB DOES NOT EXISTS";
|
||||
#"$(table_exists)&backup_exists"::
|
||||
# "DB DOES EXISTS";
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue