.. _event-cleaner: Manually Purge Old Data from Database ======================================================= .. tip:: To schedule automatic database cleanup, see :ref:`auto-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, * unmatched events (faces, bodies, cars) and related episodes, * full frames of matched events (faces, bodies, cars), * full frames of unmatched events (faces, bodies, cars), * counter records, * cluster events (faces, bodies, cars), * audit-logs, * area activations. To invoke the ``cleanup`` help message, execute: .. code:: sudo findface-security cleanup --help usage: findface-security cleanup [-h] [--as-configured] [--face-events-max-fullframe-unmatched-age FACE_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE] [--face-events-max-fullframe-matched-age FACE_EVENTS_MAX_FULLFRAME_MATCHED_AGE] [--face-events-max-unmatched-age FACE_EVENTS_MAX_UNMATCHED_AGE] [--face-events-max-matched-age FACE_EVENTS_MAX_MATCHED_AGE] [--body-events-max-fullframe-unmatched-age BODY_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE] [--body-events-max-fullframe-matched-age BODY_EVENTS_MAX_FULLFRAME_MATCHED_AGE] [--body-events-max-unmatched-age BODY_EVENTS_MAX_UNMATCHED_AGE] [--body-events-max-matched-age BODY_EVENTS_MAX_MATCHED_AGE] [--car-events-max-fullframe-unmatched-age CAR_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE] [--car-events-max-fullframe-matched-age CAR_EVENTS_MAX_FULLFRAME_MATCHED_AGE] [--car-events-max-unmatched-age CAR_EVENTS_MAX_UNMATCHED_AGE] [--car-events-max-matched-age CAR_EVENTS_MAX_MATCHED_AGE] [--car-cluster-events-max-age CAR_CLUSTER_EVENTS_MAX_AGE] [--body-cluster-events-max-age BODY_CLUSTER_EVENTS_MAX_AGE] [--face-cluster-events-max-age FACE_CLUSTER_EVENTS_MAX_AGE] [--area-activations-max-age AREA_ACTIVATIONS_MAX_AGE] [--audit-logs-max-age AUDIT_LOGS_MAX_AGE] [--counter-records-max-age COUNTER_RECORDS_MAX_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 clusters. Can't be used with other arguments. --face-events-max-fullframe-unmatched-age FACE_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE face events max fullframe unmatched age to clean up (in days) --face-events-max-fullframe-matched-age FACE_EVENTS_MAX_FULLFRAME_MATCHED_AGE face events max fullframe matched age to clean up (in days) --face-events-max-unmatched-age FACE_EVENTS_MAX_UNMATCHED_AGE face events max unmatched age to clean up (in days) --face-events-max-matched-age FACE_EVENTS_MAX_MATCHED_AGE face events max matched age to clean up (in days) --body-events-max-fullframe-unmatched-age BODY_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE body events max fullframe unmatched age to clean up (in days) --body-events-max-fullframe-matched-age BODY_EVENTS_MAX_FULLFRAME_MATCHED_AGE body events max fullframe matched age to clean up (in days) --body-events-max-unmatched-age BODY_EVENTS_MAX_UNMATCHED_AGE body events max unmatched age to clean up (in days) --body-events-max-matched-age BODY_EVENTS_MAX_MATCHED_AGE body events max matched age to clean up (in days) --car-events-max-fullframe-unmatched-age CAR_EVENTS_MAX_FULLFRAME_UNMATCHED_AGE car events max fullframe unmatched age to clean up (in days) --car-events-max-fullframe-matched-age CAR_EVENTS_MAX_FULLFRAME_MATCHED_AGE car events max fullframe matched age to clean up (in days) --car-events-max-unmatched-age CAR_EVENTS_MAX_UNMATCHED_AGE car events max unmatched age to clean up (in days) --car-events-max-matched-age CAR_EVENTS_MAX_MATCHED_AGE car events max matched age to clean up (in days) --car-cluster-events-max-age CAR_CLUSTER_EVENTS_MAX_AGE car cluster events max age to clean up (in days) --body-cluster-events-max-age BODY_CLUSTER_EVENTS_MAX_AGE body cluster events max age to clean up (in days) --face-cluster-events-max-age FACE_CLUSTER_EVENTS_MAX_AGE face cluster events max age to clean up (in days) --area-activations-max-age AREA_ACTIVATIONS_MAX_AGE area activations max age to clean up (in days) --audit-logs-max-age AUDIT_LOGS_MAX_AGE audit logs max age to clean up (in days) --counter-records-max-age COUNTER_RECORDS_MAX_AGE counter records max age to clean up (in days) --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-max-matched-age``/``--*-events-max-unmatched-age`` options, subject to the object type. For example, to remove unmatched car events older than 5 days, execute: .. code:: sudo findface-security cleanup --car-events-max-unmatched-age 5 To remove only matched car events older than 5 days, execute: .. code:: sudo findface-security cleanup --car-events-max-matched-age 5 The following commands remove only full frames of matched/unmatched body events: .. code:: sudo findface-security cleanup --body-events-max-fullframe-matched-age 5 sudo findface-security cleanup --body-events-max-fullframe-unmatched-age 5 To remove only counter records, execute: .. code:: sudo findface-security cleanup --counter-records-max-age 5 To remove only cluster events with faces, execute: .. code:: sudo findface-security cleanup --face-cluster-events-max-age 5 To remove only audit logs, execute: .. code:: sudo findface-security cleanup --audit-logs-max-age 5 To remove only area activations, execute: .. code:: sudo findface-security cleanup --area-activations-max-age 5 .. important:: You must provide at least one of the mentioned arguments.