mco_backup_progress_info

Retrieve the current progress information of an ongoing backup operation.

For an overview see page Incremental Online Backup in C

Prototype

    MCO_RET mco_backup_progress_info(
        /*IN*/  mco_db_h connection,
        /*OUT*/ mco_backup_progress_info_t *pinfo
    );

Arguments

connection
Valid database connection handle.
pinfo
Pointer to a mco_backup_progress_info_t structure that will be filled with current backup progress data. May be NULL if progress information is not needed.

Description

This function retrieves real-time progress information about an ongoing backup operation for the specified database. The data is copied from the internal progress_info field of the database's backup context (see mco_database_backup_t).

The structure contains:

If no backup operation is active, phase will be MCO_BACKUP_PROGRESS_IDLE and counters will be zero.

Incremental backup must be enabled at database creation time via the MCO_DB_INCREMENTAL_BACKUP_ENABLED flag.

See Incremental Backup and Restore for more details.

Return Codes

MCO_S_OK
Progress information successfully retrieved (or pinfo is NULL).
MCO_E_ILLEGAL_PARAM
Invalid database connection handle.
MCO_E_BACKUP_INVALID_PARAM
Incremental backup support is not enabled in the database configuration (MCO_DB_INCREMENTAL_BACKUP_ENABLED flag was not set at database creation).

Example

    {
        mco_db_h con;
        mco_backup_progress_info_t progress;
        MCO_RET rc;

        rc = mco_db_connect("mydb", &con);
        if (rc != MCO_S_OK) {
            /* handle connection error */
        }
        /* ... */
        rc = mco_backup_progress_info(con, &progress);
        if (rc == MCO_S_OK && progress.phase != MCO_BACKUP_PROGRESS_IDLE) {
            printf("Backup phase: %u, Pass: %llu/%llu, Step: %llu/%llu\n",
                (unsigned int)progress.phase,
                (unsigned long long)progress.pass_no,
                (unsigned long long)progress.max_passes,
                (unsigned long long)progress.step_no,
                (unsigned long long)progress.max_steps);
        }
    }

Files

Header file:
mco.h
Source file:
mcoabst.c
Library:
libmcolib.a