Stop the asynchronous backup process.
MCO_RET mco_async_backup_stop(
/*IN*/ mco_db_h connection,
/*IN*/ int force
);
connection
force
0 — allow the current backup cycle to complete before stopping (graceful shutdown),This function terminates the asynchronous backup cycle associated with the given database connection.
If
forceis zero, the function waits for the current backup record to be fully written before stopping. Ifforceis non-zero, the backup thread is terminated immediately, which may result in a corrupted or incomplete backup record in the file.Use forced termination only in exceptional circumstances (e.g., system shutdown or critical error).
See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_BACKUP
{
const char *db_name = "myDb";
mco_db_h con;
MCO_RET rc;
rc = mco_db_connect(db_name, &con);
if (rc != MCO_S_OK) {
/* handle connection error */
}
/* Forcefully stop the backup process */
rc = mco_async_backup_stop(con, 1);
if (rc != MCO_S_OK) {
/* handle stop error (e.g., no active backup) */
}
}