Need Help with deleting DagFiles from FileSystem using Airflow CLI #60954
Unanswered
prayaagmahajan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to delete my dag files from my internal file system. I know its easy that I go and delete those but before that, I want to know the Dag Status and delete only the Dag's with status 'Success\Failed'
Steps I am trying.
cleanup_old_dag_files() {
DAYS_AGO=2
CUTOFF_TS=$(date -u -d "$DAYS_AGO hours ago" +"%Y-%m-%dT%H:%M:%S")
done
}
But this is inefficient as I have to iterate over many dag files get their Dag Id and then check for their status and then Os.Remove from the path.
Is there any other way round which I can use to get all dags that has status 'success/failed' in a single cli script.
I am currently using airflow 3.1.3.
Beta Was this translation helpful? Give feedback.
All reactions