mco_async_backup_progress_info

Retrieve the current status of an asynchronous backup or restore operation.

For an overview see page Incremental Online Backup in C

Prototype

    MCO_RET mco_async_backup_progress_info(
        /*IN*/  mco_db_h connection,
        /*OUT*/ mco_async_backup_progress_info_t *info
    );

Arguments

connection
Database connection handle associated with the active backup/restore operation.
info
Pointer to a mco_async_backup_progress_info_t structure that will be filled with current progress data.

Description

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.

Return Codes

MCO_S_OK
Progress information successfully retrieved.

Example

    {
        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);
            }
        }
    }

Files

Header file:
mco.h
Source file:
mcobackup.c
Library:
libmcobackup.a