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.

To invoke the cleanup_events help message, execute:

findface-security cleanup_events --help
usage: findface-security cleanup_events [-h] [--matched-age MATCHED_AGE]
                                        [--unmatched-age 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
  --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 remove events and episodes older than a given number of days, use the --age option. 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

Important

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