title: Remove Airflow Scheduler logs
body: <p>I am using Docker Apache airflow VERSION 1.9.0-2 (<a href="https://github.com/puckel/docker-airflow" rel="noreferrer">https://github.com/puckel/docker-airflow</a>).  </p>
  
  <p>The scheduler produces a significant amount of logs, and the filesystem will quickly run out of space, so I am trying to programmatically delete the scheduler logs created by airflow, found in the scheduler container in (/usr/local/airflow/logs/scheduler)</p>
  
  <p>I have all of these maintenance tasks set up:
  <a href="https://github.com/teamclairvoyant/airflow-maintenance-dags" rel="noreferrer">https://github.com/teamclairvoyant/airflow-maintenance-dags</a></p>
  
  <p>However, these tasks only delete logs on the worker, and the scheduler logs are in the scheduler container.</p>
  
  <p>I have also setup remote logging, sending logs to S3, but as mentioned in this SO post <a href="https://stackoverflow.com/questions/43548744/removing-airflow-task-logs">Removing Airflow task logs</a> this setup does not stop airflow from writing to the local machine.</p>
  
  <p>Additionally, I have also tried creating a shared named volume between the worker and the scheduler, as outlined here <a href="https://stackoverflow.com/questions/44284484/docker-compose-share-named-volume-between-multiple-containers">Docker Compose - Share named volume between multiple containers</a>.  However, I get the following error in worker:</p>
  
  <p><code>ValueError: Unable to configure handler 'file.processor': [Errno 13] Permission denied: '/usr/local/airflow/logs/scheduler'</code></p>
  
  <p>and the following error in scheduler:</p>
  
  <p><code>ValueError: Unable to configure handler 'file.processor': [Errno 13] Permission denied: '/usr/local/airflow/logs/scheduler/2018-04-11'</code></p>
  
  <p><strong>And so, how do people delete scheduler logs??</strong></p>