A maintenance workflow that you can deploy into Airflow to periodically take backups of various Airflow configurations and files.
-
Login to the machine running Airflow
-
Navigate to the dags directory
-
Copy the airflow-backup-configs.py file to this dags directory
a. Here's a fast way: $ wget https://raw.githubusercontent.com/teamclairvoyant/airflow-maintenance-dags/master/backup-configs/airflow-backup-configs.py
-
Update the global variables (SCHEDULE_INTERVAL, DAG_OWNER_NAME, ALERT_EMAIL_ADDRESSES, BACKUP_FOLDER_DATE_FORMAT, BACKUP_HOME_DIRECTORY, BACKUPS_ENABLED, and BACKUP_RETENTION_COUNT) in the DAG with the desired values
-
Enable the DAG in the Airflow Webserver