clean
Usage
$ airflow db clean [-h] --clean-before-timestamp CLEAN_BEFORE_TIMESTAMP
[--dry-run]
[--skip-archive]
[-t TABLES]
[-v]
[-y]
Arguments
| Parameter | Description |
|---|---|
--clean-before-timestamp |
Purge data created before the specified timestamp. If no timezone info is supplied, then the dates are assumed to be in Airflow default timezone. Example: |
--dry-run |
Perform a dry run. Default: |
--skip-archive |
Do not preserve purged records in an archive table. Default: |
-t, --tables |
The names of the tables to be dropped. Accepts a comma-separated list. Possible values: |
-y, --yes |
Do not prompt to confirm. Default: |
-h, --help |
Print out the help manual for this command |
-v, --verbose |
Make logging output more verbose |
Examples
To purge records from the task_fail table, run:
$ airflow db clean --clean-before-timestamp 2025-04-03T12:42:04.284+0000 -t task_fail
Output example:
You have requested that we purge all data prior to 2025-04-03T12:42:04.284000+00:00 for tables ['task_fail']. This is irreversible. Consider backing up the tables first and / or doing a dry run with option --dry-run. Enter 'delete rows' (without quotes) to proceed. delete rows Checking table task_fail Found 1 rows meeting deletion criteria. Performing Delete... Moving data to table _airflow_deleted__task_fail__20250403043257 Finished Performing Delete