Have the script determine the period, rather than the cron.

This commit is contained in:
Chris Sewell
2012-12-03 06:34:01 -05:00
parent 7741dd6acd
commit 900ff8ff3f

View File

@ -16,9 +16,16 @@ MYSQLDUMPPATH=
#tmp path.
TMP_PATH=~/
PERIOD=${1-day}
DATESTAMP=$(date +".%m.%d.%Y")
DAY=$(date +"%d")
DAYOFWEEK=$(date +"%A")
if [ ${DAY} = "01" ]; then
PERIOD=month
elif [ ${DAYOFWEEK} = "Sunday" ]; then
PERIOD=week
else
PERIOD=day
fi
echo "Selected period: $PERIOD."