#!/bin/bash

set +x

# for sheduling
if [ "$DAYS" = "0" ]; then
date1=$(date -d "-$SKIP days" +"%s")
for VARIABLE in 0 1 2 3
do
	date2=$(date -d "$VARIABLE months ago" +"%s")
	diff=$(($date1-$date2))
	new_skip=$(($diff/(60*60*24)))
	python feed_ingestion/bin/exec_flows.py youtube_red_marketshare --skip $new_skip --days "1" --check-status
done
else # for standard launch
python feed_ingestion/bin/exec_flows.py youtube_red_marketshare --skip $SKIP --days $DAYS --check-status
fi
