Check the backup consistency without restoring the database.
void mco_backup_verify(
/*IN*/ mco_db_h con,
/*IN*/ const char *file_name,
/*IN*/ const char *label,
/*IN*/ const char *cipher,
/*IN*/ char *err_buf,
/*IN-OUT*/ unsigned int *err_buf_sz
);
con
file_name
label
cipher
NULL for unencrypted backups.err_buf
NULL if error details are not needed).err_buf_sz
err_buf. On output: number of characters written. If NULL, the function returns
MCO_E_ILLEGAL_PARAM.This function validates the integrity of a backup file by reading all records from the most recent snapshot up to the specified
labeland verifying their CRC checksums. It performs the same data validation steps asmco_backup_restore(), but does not modify the database.This is useful for confirming that a backup is complete, consistent, and ready for future restoration.
See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_DISK_OPEN
MCO_E_ILLEGAL_PARAM
label was not found,MCO_E_DISK_SEEK
{
mco_db_h con;
MCO_RET rc;
const char *filename = "backup.bak";
const char *label = "v1.2";
rc = mco_db_connect("mydb", &con);
if (rc != MCO_S_OK) {
/* handle connection error */
}
rc = mco_backup_verify(con, filename, label, NULL, NULL);
if (rc != MCO_S_OK) {
/* handle verification error */
}
}