#! /bin/bash
set -euo pipefail

MISSED_DATES=( `./missed_dates 33` )
#export MAILTO="n-bar@yandex-team.ru"

if [[ ${#MISSED_DATES[@]} != 0 && $? == 0 ]]
then
    echo ${MISSED_DATES[@]} | xargs -n 1 ./yql/run
else
    exit 1
fi
