Feature to restore database implemented
This commit is contained in:
parent
a6a149a156
commit
1cd5758f05
28
vimbadmin.cf
28
vimbadmin.cf
|
@ -4,11 +4,13 @@
|
|||
|
||||
bundle agent vimbadmin(cfg)
|
||||
{
|
||||
classes:
|
||||
"vimbadmin_restore_db_file" expression => isvariable("cfg[restore_db_file]");
|
||||
|
||||
vimbadmin_restore_db_file::
|
||||
"vimbadmin_restore_db" expression => fileexists("$(cfg[restore_db_file])");
|
||||
|
||||
vars:
|
||||
"r" int => randomint(1,5),
|
||||
handle => "rand_assigned";
|
||||
|
||||
|
||||
"vsettings[resources.doctrine2.connection.options.driver]" string => "'$(cfg[db_driver])'";
|
||||
"vsettings[resources.doctrine2.connection.options.dbname]" string => "'$(cfg[db_name])'";
|
||||
"vsettings[resources.doctrine2.connection.options.user]" string => "'$(cfg[db_user])'";
|
||||
|
@ -88,9 +90,15 @@ files:
|
|||
|
||||
commands:
|
||||
|
||||
"!mysql_$(cfg[db_name])_admin_exists"::
|
||||
"(!mysql_$(cfg[db_name])_admin_exists)&(!vimbadmin_restore_db)"::
|
||||
"cd $(cfg[install_dir]) && ./bin/doctrine2-cli.php orm:schema-tool:create "
|
||||
contain => wmde_cmd_useshell,
|
||||
handle => "vimbadmin_db_initialized",
|
||||
depends_on => {"vimbadmin_appini_edited"};
|
||||
|
||||
"(!mysql_$(cfg[db_name])_admin_exists)&vimbadmin_restore_db"::
|
||||
"mysql -u $(cfg[db_user]) -p$(cfg[db_pass]) -h$(cfg[db_host]) $(cfg[db_name]) < $(cfg[restore_db_file])"
|
||||
contain => wmde_cmd_useshell,
|
||||
depends_on => {"vimbadmin_appini_edited"};
|
||||
|
||||
|
||||
|
@ -121,6 +129,16 @@ methods:
|
|||
"any" usebundle => mysql_table_exists(@(cfg),"admin");
|
||||
|
||||
reports:
|
||||
# "VIMBADMIN $(cfg[restore_db_file])";
|
||||
|
||||
# "vimbadmin_restore_db_file"::
|
||||
# "RESTORE_DB_FILE";
|
||||
|
||||
# "vimbadmin_restore_db"::
|
||||
# "RESTORE_DB";
|
||||
|
||||
# "(!mysql_$(cfg[db_name])_admin_exists)&vimbadmin_restore_db"::
|
||||
# "Should restore db";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue