How to add new DAGs to Airflow?
I might be using the latest airflow, the command has changed. What works for me is:
export AIRFLOW_HOME="~/airflow"
- Then run
airflow dags list
In my understanding, AIRFLOW_HOME
should link to the directory where airflow.cfg
is stored. Then, airflow.cfg
can apply and set the dag directory to the value you put in it.
The important point is : airflow.cfg
is useless if your AIRFLOW_HOME
is not set
The issue is that you might have two airflow configs existing in your directories, so check for /root/airflow/dags and if yes you require to change the dags_folder path in both airflow.cfg s
I think the reason for this is because you haven't exported AIRFLOW_HOME
.
Try doing:
AIRFLOW_HOME="/home/alex/airflow/dags" airflow list_dags
.
If that's not working than do two steps
export AIRFLOW_HOME="/home/alex/airflow/dags"
airflow list_dags
I believe this should work. Give it a go?