Retrieve the current status of an asynchronous backup or restore operation.
MCO_RET mco_async_backup_progress_info(
/*IN*/ mco_db_h connection,
/*OUT*/ mco_async_backup_progress_info_t *info
);
connection
info
mco_async_backup_progress_info_t structure that will be
filled with current progress data.This function retrieves real-time status information about an ongoing asynchronous backup or restore process. The data includes the current phase, progress counters, file name, label, error status, and other operational details.
If no asynchronous operation is active, the returned structure will reflect an idle state (
MCO_BACKUP_PROGRESS_IDLE).See Incremental Backup and Restore for more details.
MCO_S_OK
{
mco_db_h con;
MCO_RET rc;
const char *db_name = "myDb";
mco_async_backup_progress_info_t abinfo;
rc = mco_db_connect(db_name, &con);
if (rc != MCO_S_OK) {
/* handle connection error */
}
rc = mco_async_backup_progress_info(con, &abinfo);
if (rc == MCO_S_OK) {
printf("Backup phase: %s\n",
abinfo.core_info.phase == MCO_BACKUP_PROGRESS_IDLE ? "IDLE" :
abinfo.core_info.phase == MCO_BACKUP_PROGRESS_LOOPING ? "LOOPING" :
abinfo.core_info.phase == MCO_BACKUP_PROGRESS_FINALIZING? "FINALIZING" :
"UNKNOWN");
if (abinfo.last_error_code != MCO_S_OK) {
printf("Last error: %s (%u)\n",
abinfo.last_error_msg ? abinfo.last_error_msg : "no message",
abinfo.last_error_code);
}
}
}