Your Airflow home is growing. Your disk is not.
Every run leaves another log behind. Rotations stack up. Empty folders linger after you delete the obvious files. You mean to clean on the weekend, then a monitoring alert beats you to it.
Airflow Logs Cleanup is a small Python utility that deletes aged log files and prunes empty directories on a schedule you control, as a one-off script or an Airflow DAG.
Set the retention rule once. Let the job run.
What you get
- Less manual housekeeping. Automated passes remove old log files and rotated dag processor manager logs so you are not guessing which files are safe to delete.
- A default you can change. The shipped retention window is seven days unless you edit the constant in the repository scripts.
- Two ways to run it. Fire the cleanup manually when you want, or drop in the example DAG and enable it in the UI.
- Tidier log folders. Empty directories left after deletion are removed, with safeguards for sensitive paths described in the project docs.
- Failures that do not halt the run. Missing paths, permission problems, and a missing home variable are logged and the cleanup continues where it can.
- Free and open source. MIT licensed on GitHub.
Picture a quiet Tuesday morning
For example, your team enables the example DAG before log volume becomes an incident. It runs on its daily schedule while you focus on failing tasks, not on which dated folders under your Airflow home are safe to remove.
Ready to try it?
- Airflow Logs Cleanup on GitHub for the standalone script, the example DAG, and setup steps
Keep exploring
- Automate Airflow log cleanup: a walkthrough of scheduling cleanup so logs do not outgrow your disk.






