Skip to content

Instantly share code, notes, and snippets.

@tym-xqo
Created March 18, 2016 20:20
Show Gist options
  • Save tym-xqo/36fe4cc2f3b186f9ca08 to your computer and use it in GitHub Desktop.
Save tym-xqo/36fe4cc2f3b186f9ca08 to your computer and use it in GitHub Desktop.
loop-by-date.sh
#!/bin/bash
last="2016-02-23"
first="2015-12-31"
i=1
while [[ $last > $first ]]; do
this=$(date -I -d "$last - 3 days")
printf -v j "%02d" $i
luigi --module=etl_scripts.dfp_ad_unit_viewable DFPAdUnitViewableByNetwork --report-name="auv_backfill$j" --period="$this-$last" --workers=12
last=$(date -I -d "$this - 1 day")
(( i++ ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment