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.

To invoke the cleanup_events help message, execute:

sudo findface-security cleanup_events --help
usage: findface-security cleanup_events [-h] [--version] [-v {0,1,2,3}]
                                               [--settings SETTINGS]
                                               [--pythonpath PYTHONPATH]
                                               [--traceback] [--no-color]
                                               --age AGE

Delete old events

optional arguments:
 -h, --help            show this help message and exit
 --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.
 --age AGE             Minimum age in days of events to clean up

In order to remove events and episodes older than a given number of days, use the --age option. For example, to remove events and episodes older than 5 days, execute:

sudo findface-security cleanup_events --age 5