Add back the ability to have the period set by the cron to stay backwards compatible with anyone that was using a cron to specifically run only weekly, only monthly or any other specific backup.

This commit is contained in:
Chris Sewell
2012-12-03 06:45:31 -05:00
parent 900ff8ff3f
commit 97e9f125ba

View File

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