mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set end=NOW(), result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
$MYSQL_CLIENT-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set end=NOW(), result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
}
}
pauseJob()
pauseJob()
{
{
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"select sleep(6);set sql_log_bin=0;UPDATE replication_manager_schema.jobs set result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
$MYSQL_CLIENT-e"select sleep(6);set sql_log_bin=0;UPDATE replication_manager_schema.jobs set result=LOAD_FILE('{{ parameter_dict['log-dir'] }}/dbjob.out') WHERE id='$ID';" &
}
}
partialRestore()
partialRestore()
{
{
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;install plugin BLACKHOLE soname 'ha_blackhole.so'"
cat$BACKUPDIR/xtrabackup_info | grep binlog_pos | awk-F, '{ print $3 }' | sed-e's/GTID of the last change/set sql_log_bin=0;set global gtid_slave_pos=/g' | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$USER
cat$BACKUPDIR/xtrabackup_info | grep binlog_pos | awk-F, '{ print $3 }' | sed-e's/GTID of the last change/set sql_log_bin=0;set global gtid_slave_pos=/g' | mysql -h{{ parameter_dict['ip']}}-P{{ parameter_dict['port']}}-p$PASSWORD-u$USER
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"flush privileges;start slave;"
mysql --defaults-file={{ parameter_dict['dbjob-cnf']}}-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set done=1 WHERE done=0 AND task='$job';"
$MYSQL_CLIENT-e"set sql_log_bin=0;UPDATE replication_manager_schema.jobs set done=1 WHERE done=0 AND task='$job';"