Skip to content

example_dags/cron_replacement.py #30

@alexanderdean

Description

@alexanderdean

I really like the concept of Airflow but I've been stumped trying to get a simple cron replacement example DAG working.

I took the example_bash_operator.py and changed args like so:

 args = {
    'owner': 'airflow',
    'start_date': datetime.now(),
    'schedule_interval': timedelta(minutes = 5)
}

I was expecting this DAG to start now and run every 5 minutes, but instead the scheduler runs the DAG in a loop, back-to-back.

I'd imagine migrating from cron to Airflow would be a pretty common use case - it would be awesome to see an example DAG for replacing e.g. a cron that runs every 6 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions