Manually Purge Old Data from Database

Tip

To schedule automatic database cleanup, see Automatic Event And Episode Cleanup.

To manually remove old data from the FindFace Multi database, use the cleanup utility. You can separately remove the following data:

  • matched events (faces, bodies, cars) and related episodes (currently only faces),

  • unmatched events (faces, bodies, cars) and related episodes (faces),

  • full frames of matched events (faces, bodies, cars),

  • full frames of unmatched events (faces, bodies, cars),

  • counter records,

  • person events,

  • audit-logs,

  • area activations.

To invoke the cleanup help message, execute:

sudo findface-security cleanup --help
usage: findface-security cleanup [-h] [--as-configured]
                                 [--car-events-matched-age CAR_EVENTS_MATCHED_AGE]
                                 [--car-events-unmatched-age CAR_EVENTS_UNMATCHED_AGE]
                                 [--car-events-fullframe-matched-age CAR_EVENTS_FULLFRAME_MATCHED_AGE]
                                 [--car-events-fullframe-unmatched-age CAR_EVENTS_FULLFRAME_UNMATCHED_AGE]
                                 [--face-events-matched-age FACE_EVENTS_MATCHED_AGE]
                                 [--face-events-unmatched-age FACE_EVENTS_UNMATCHED_AGE]
                                 [--face-events-fullframe-matched-age FACE_EVENTS_FULLFRAME_MATCHED_AGE]
                                 [--face-events-fullframe-unmatched-age FACE_EVENTS_FULLFRAME_UNMATCHED_AGE]
                                 [--body-events-matched-age BODY_EVENTS_MATCHED_AGE]
                                 [--body-events-unmatched-age BODY_EVENTS_UNMATCHED_AGE]
                                 [--body-events-fullframe-matched-age BODY_EVENTS_FULLFRAME_MATCHED_AGE]
                                 [--body-events-fullframe-unmatched-age BODY_EVENTS_FULLFRAME_UNMATCHED_AGE]
                                 [--counter-records-age COUNTER_RECORDS_AGE]
                                 [--person-events-age PERSON_EVENTS_AGE]
                                 [--audit-logs-age AUDIT_LOGS_AGE]
                                 [--area-activations-age AREA_ACTIVATIONS_AGE]
                                 [--configuration CONFIGURATION] [--version]
                                 [-v {0,1,2,3}] [--settings SETTINGS]
                                 [--pythonpath PYTHONPATH] [--traceback]
                                 [--no-color] [--force-color] [--skip-checks]

Delete FFSecurity entities

optional arguments:
  -h, --help            show this help message and exit
  --as-configured       Apply config age options for events, counter records
                        and persons. Can't be used with other arguments.
  --car-events-matched-age CAR_EVENTS_MATCHED_AGE
                        Minimum age in days of matched car events to clean up
  --car-events-unmatched-age CAR_EVENTS_UNMATCHED_AGE
                        Minimum age in days of unmatched car events to clean
                        up
  --car-events-fullframe-matched-age CAR_EVENTS_FULLFRAME_MATCHED_AGE
                        Minimum age in days of matched car events fullframes
                        to clean up
  --car-events-fullframe-unmatched-age CAR_EVENTS_FULLFRAME_UNMATCHED_AGE
                        Minimum age in days of unmatched car events fullframes
                        to clean up
  --face-events-matched-age FACE_EVENTS_MATCHED_AGE
                        Minimum age in days of matched face events to clean up
  --face-events-unmatched-age FACE_EVENTS_UNMATCHED_AGE
                        Minimum age in days of unmatched face events to clean
                        up
  --face-events-fullframe-matched-age FACE_EVENTS_FULLFRAME_MATCHED_AGE
                        Minimum age in days of matched face events fullframes
                        to clean up
  --face-events-fullframe-unmatched-age FACE_EVENTS_FULLFRAME_UNMATCHED_AGE
                        Minimum age in days of unmatched face events
                        fullframes to clean up
  --body-events-matched-age BODY_EVENTS_MATCHED_AGE
                        Minimum age in days of matched body events to clean up
  --body-events-unmatched-age BODY_EVENTS_UNMATCHED_AGE
                        Minimum age in days of unmatched body events to clean
                        up
  --body-events-fullframe-matched-age BODY_EVENTS_FULLFRAME_MATCHED_AGE
                        Minimum age in days of matched body events fullframes
                        to clean up
  --body-events-fullframe-unmatched-age BODY_EVENTS_FULLFRAME_UNMATCHED_AGE
                        Minimum age in days of unmatched body events
                        fullframes to clean up
  --counter-records-age COUNTER_RECORDS_AGE
                        Minimum age in days of counter records to clean up
  --person-events-age PERSON_EVENTS_AGE
                        Minimum age in days of person events to clean up
  --audit-logs-age AUDIT_LOGS_AGE
                        Minimum age in days of audit logs to clean up
  --area-activations-age AREA_ACTIVATIONS_AGE
                        Minimum age in days of area activations to clean up
  --configuration CONFIGURATION
                        The name of the configuration class to load, e.g.
                        "Development". If this isn't provided, the
                        DJANGO_CONFIGURATION environment variable will be
                        used.
  --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.
  --force-color         Force colorization of the command output.
  --skip-checks         Skip system checks

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

sudo findface-security cleanup --car-events-unmatched-age 5

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

sudo findface-security cleanup --car-events-matched-age 5

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

sudo findface-security cleanup --body-events-fullframe-matched-age 5
sudo findface-security cleanup --body-events-fullframe-unmatched-age 5

To remove only counter records, execute:

sudo findface-security cleanup --counter-records-age 5

To remove only person events, execute:

sudo findface-security cleanup --person-events-age 5

To remove only audit logs, execute:

sudo findface-security cleanup --audit-logs-age 5

To remove only area activations, execute:

sudo findface-security cleanup --area-activations-age 5

Important

You must provide at least one of the mentioned arguments.