#! /bin/sh MFD=/var/log/MFD.out # Have a rolling refresh one week from now, since one channel has a bunch # of shows running one week late arg="--refresh-day 7" # Several shows are maybe re-broadcast on the weekend, so we want to force # the weekend to refresh while we still have a chance to record them today day=`date +%u` # %u day of week (1..7); 1 is Monday saturday=`expr 6 - $day` sunday=`expr 7 - $day` if [ $day -le 4 ]; then arg="$arg --refresh-day $saturday --refresh-day $sunday" fi # With the random start times sometimes when we run just past midnight it # can mean that the data for today isn't refreshed with the default behaviour hour=`date +%H` if [ $hour -le 6 ]; then arg="$arg --refresh-today" fi optimize_mythdb.pl mythfilldatabase --remove-new-channels $arg | tee $MFD