4 DbDump
David Anderson edited this page 2023-08-22 13:15:33 -07:00

Exporting credit statistics with db_dump

The program db_dump generates XML files containing your project's credit data. This data is used by 3rd-party sites to generate some charts and graphs. It should be run every 24 hours. Include an entry like

    <tasks>
        <task>
            <cmd>db_dump -d 2 -dump_spec ../db_dump_spec.xml</cmd>
            <output>db_dump.out</output>
            <period>24 hours</period>
        </task>
    </tasks>

in your config.xml file. Make sure the file db_dump_spec.xml is in your project's root directory. This file should look like this:

    <boinc_db_dump_spec>
        <output_dir>../html/stats_tmp</output_dir>
        <final_output_dir>../html/stats</final_output_dir>
        <enumeration>
            <table>user</table>
            <filename>user</filename>
            <output>
                <compression>gzip</compression>
            </output>
        </enumeration>
        <enumeration>
            <table>user_deleted</table>
            <filename>user_deleted</filename>
            <output>
                <compression>gzip</compression>
            </output>
        </enumeration>
        <enumeration>
            <table>host</table>
            <filename>host</filename>
            <output>
                <compression>gzip</compression>
                <detail/>
            </output>
        </enumeration>
        <enumeration>
            <table>host_deleted</table>
            <filename>host_deleted</filename>
            <output>
                <compression>gzip</compression>
            </output>
        </enumeration>
        <enumeration>
            <table>team</table>
            <filename>team</filename>
            <output>
                <compression>gzip</compression>
            </output>
        </enumeration>
    </boinc_db_dump_spec>

The XML files are written to <final_output_dir>, and the old stats/ directory is renamed to stats_DATE. This clutters up your html/ directory; if you don't like this, create a directory html/stats_archive/ and add the following line to your db_dump_spec.xml file:

<archive_dir>../html/stats_archive</archive_dir>

If you've set up groups and permissions correctly, you need a 755 permission on the stats directories only.