#!/bin/bash

# Perform the two stages of MPC export if the export flag file is present.

if [ -e $MOPS_VAR/config/EXPORT_DATA_TO_MPC_WHEN_PRESENT ]; then
    echo "Performing MPC export on database $MOPS_DBINSTANCE."

    $MOPS_MPC_EXPORT/bin/process-dos-all.pl --noprompt $MOPS_DBINSTANCE
    $MOPS_MPC_EXPORT/bin/export-pending-mops-objects-to-mpc-datastore.pl --noprompt $MOPS_DBINSTANCE
else
    echo "Data will NOT be exported to the MPC."
fi
