************************* Database Scrubbing Module ************************* The database scrubbing utility is used to to delete data from METviewer databases that meets some user-specified selection criteria. The usage statement: .. code-block:: none ---- Database Scrubbing ---- Usage: mv_prune.sh prune_db_spec_file where prune_db_spec_file specifies the XML pruning specification document ---- Database Scrubbing Done ---- The prune_db_spec_file passed to the pruning module contains information about the criteria for deleting data. It is an XML file with the top-level tag **** which contains the elements described below, divided into functional sections. The data to be deleted may be specified in one of three ways: as a list of file names, as a list of directories, or as a set of values for various fields in the data. **:** Please reference the `Common XML Structures `_ documentation. **:** **TRUE** or **FALSE**, this option indicates if the data to be deleted should only be listed (**TRUE**) or the actual deletion performed (**FALSE**). | **:** A list of fields used for pruning. | **:** An inclusive range for continuous variables, such as dates. | **:** Beginning of the range. | **:** End of the range. | | **OR** | | **:** A list of values, such as models. | **:** A single value. | | **OR** | | **:** A set of files to be removed. | **:** File name. | | **OR** | | **:** A set of directories to be removed. | **:** A template string describing the file structure of the MET files, which is populated with values specified in the **** tag structure. | **:** Please reference the `Common XML Structures `_ documentation. | | **:** A tree structure containing values used to populate the **** template. | **:** A template value, its name is specified by the attribute name, and its values are specified by its children **** tags. | **:** A single template value which will slot into the template in the value specified by the parent field's name. | **:** Specifies a previously declared **** element, using the name attribute, which represents a list of dates in a particular format. | Examples ======== **Example 1: Prune by describing the data ()** The following configuration will remove data from database 'mv_database' that has model names NAM and GFS, forecast variable APCP_03 and forecast valid dates between 2013-07-05 06:00 and 2013-07-05 18:00:00 .. code-block:: XML db_host:3306 mv_database user_name user_password false 2013-07-05 06:00:00 2013-07-05 18:00:00 NAM GFS APCP_03 **Example 2: Prune by a list of files () and by a list of directories ()** This configuration will remove data from database 'mv_database' that was loaded from the following files: /d3/metprd/grid_stat/grid_stat_APCP_03_030000L_20130705_030000V.stat /d3/metprd/mode/mode_APCP_06_180000L_20130705_180000V_060000A_obj.txt And from the following directories: */d1/data/arw/FULL/2010051914* */d1/data/arw/SWC/2010051914* */d1/data/nmm/FULL/2010051914* */d1/data/nmm/SWC/2010051914* */d1/data/arw/FULL/2010051915* */d1/data/arw/SWC/2010051915* */d1/data/nmm/FULL/2010051915* */d1/data/nmm/SWC/2010051915* .. code-block:: XML db_host:3306 mv_database user_name user_password false /d3/metprd/grid_stat/grid_stat_APCP_03_030000L_20130705_030000V.stat /d3/metprd/grid_stat/grid_stat_APCP_03_030000L_20130705_030000V.stat 2010051914 2010051915 3600 yyyyMMddHH /d1/data/{model}/{vx_mask}/{valid_time} arw nmm FULL SWC