Skip to content

Instantly share code, notes, and snippets.

@charsyam
Created November 20, 2020 13:22
Show Gist options
  • Save charsyam/d683d3aa6e9022ea8afeda4358169005 to your computer and use it in GitHub Desktop.
Save charsyam/d683d3aa6e9022ea8afeda4358169005 to your computer and use it in GitHub Desktop.
DAG=$1
START=$2
END=$3
run() {
CMD="airflow backfill $DAG -s $1"
$CMD
RET=$?
return $RET
}
INC=0
while true
do
D=`date -d "$START $INC day" +%Y-%m-%d`
INC=$((INC + 1))
echo "$D"
run $D
if [ $? -ne 0 ]; then
echo "Error $D $?"
break
fi
if [ $END == $D ]; then
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment