Manually Purge Old Events and Episodes from Database

Tip

To schedule automatic events and episodes cleanup, see Automatic Event And Episode Cleanup.

To manually remove old events and related episodes from the FindFace Security database, use the cleanup_events utility. You can opt for removing only matched or unmatched events, as well as only full frames.

To invoke the cleanup_events help message, execute:

sudo findface-security cleanup_events --help
usage: findface-security cleanup_events [-h] [--matched-age MATCHED_AGE]
                    [--unmatched-age UNMATCHED_AGE]
                    [--fullframe-matched-age FULLFRAME_MATCHED_AGE]
                    [--fullframe-unmatched-age FULLFRAME_UNMATCHED_AGE]
                    [--version] [-v {0,1,2,3}]
                    [--settings SETTINGS]
                    [--pythonpath PYTHONPATH]
                    [--traceback] [--no-color]
Delete old events
optional arguments:
 -h, --help      show this help message and exit
 --matched-age MATCHED_AGE
            Minimum age in days of matched events to clean up
 --unmatched-age UNMATCHED_AGE
            Minimum age in days of unmatched events to clean up
 --fullframe-matched-age FULLFRAME_MATCHED_AGE
            Minimum age in days of matched events fullframes to
            clean up
 --fullframe-unmatched-age FULLFRAME_UNMATCHED_AGE
            Minimum age in days of unmatched events fullframes to
            clean up
 --version       show program's version number and exit
 -v {0,1,2,3}, --verbosity {0,1,2,3}
            Verbosity level; 0=minimal output, 1=normal output,
            2=verbose output, 3=very verbose output
 --settings SETTINGS  The Python path to a settings module, e.g.
            "myproject.settings.main". If this isn't provided, the
            DJANGO_SETTINGS_MODULE environment variable will be
            used.
 --pythonpath PYTHONPATH
            A directory to add to the Python path, e.g.
            "/home/djangoprojects/myproject".
 --traceback      Raise on CommandError exceptions
 --no-color      Don't colorize the command output.

To entirely remove events and episodes older than a given number of days, use the --matched-age/--unmatched-age options. For example, to remove unmatched events and episodes older than 5 days, execute:

sudo findface-security cleanup_events --unmatched-age 5

To remove only matched events and episodes older than 5 days, execute:

sudo findface-security cleanup_events --matched-age 5

The following commands remove only full frames of matched/unmatched events:

sudo findface-security cleanup_events --fullframe-matched-age 5
sudo findface-security cleanup_events --fullframe-unmatched-age 5

Important

You must provide at least one of the arguments --matched-age/--unmatched-age/--fullframe-matched-age, --fullframe-unmatched-age.