How to cancel a ZRM restore job

This article is for Zmanda Recovery Manager For MySQL (ZRM)

CAUTION: Please note that canceling a restore job might leave the databases in an inconsistent state if you are restoring to original location.

Use this procedure only if the cancel button in the ZRM Restore Restore page does not work. Please follow these steps to stop a restore job as “root” user on the ZRM server:

  1. Check for “zmc_launcher” process(es)
     pgrep -f "zmc_launcher" -l 
  2. Kill all “zmc_launcher” process(es) if all are related to the restore
    pkill -9 "zmc_launcher"
  3. Check for “mysql-zrm-restore-wrapper” process(es)
    pgrep -f "mysql-zrm-restore-wrapper" -l
  4. Kill all “mysql-zrm-restore-wrapper” process(es) if all are related to the restore
    pkill -9 "mysql-zrm-restore-wrapper"
  5. Check for “mysql-zrm-restore” process(es)
    pgrep -f "mysql-zrm-restore" -l
  6. Kill all running “mysql-zrm-restore” process(es) if all are related to the restore
    pkill -9 "mysql-zrm-restore"
  7. Remove PID file for restore run from backup set’s configuration directory
    rm /etc/mysql-zrm/<backup set name>/
  8. Run below to clean up ZMC
  9. Please refresh the ZMC Restore Restore page.

If ZMC still reports that the restore job is still running or in cancelling state, do the following:

  1. Obtain the restore job task id with the below MySQL query were <backup-set> is the name of your backup-set
    # /opt/zmanda/zrm/mysql/bin/mysql -uroot -pzmcdb-admin zmc -e "selectmax(task_id) from task_management where task_name='Restore' and
    configuration_id =(SELECT configuration_id FROM configurations WHERE
    configuration_name = '<backup-set>')";
  2. Use the task_id returned in the above query where it says <task_id> in the below query to update the restore task in ZMC's task table:
    # /opt/zmanda/zrm/mysql/bin/mysql -uroot -pzmcdb-admin zmc -e "UPDATE
    task_management SET status='Cancelled',output='Cancelled forcefully' where
  3. On the client machine, the restore processes will terminate automatically if the connection is broken with server.  As a precaution we can check for and kill any processes still running on the client machine as well:
    # pgrep -f "mysql-zrm" -l
    if the returned process(es) is related to the restore and not a backup, it may be terminated:
    # pkill -9 "mysql-zrm"
    # /etc/init.d/xinet.d restart