Skip to content
Browse files

Add back the ability to have the period set by the cron to stay backw…

…ards compatible with anyone that was using a cron to specifically run only weekly, only monthly or any other specific backup.
  • Loading branch information...
1 parent 900ff8f commit 97e9f125ba74b89d40a289e643e7b1899baa0999 @WootRoot WootRoot committed
Showing with 10 additions and 6 deletions.
  1. +10 −6 mysqltos3.sh
View
16 mysqltos3.sh
@@ -19,12 +19,16 @@ TMP_PATH=~/
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
+
+PERIOD=${1-day}
+if [ ${PERIOD} = "auto" ]; then
+ if [ ${DAY} = "01" ]; then
+ PERIOD=month
+ elif [ ${DAYOFWEEK} = "Sunday" ]; then
+ PERIOD=week
+ else
+ PERIOD=day
+ fi
fi
echo "Selected period: $PERIOD."

0 comments on commit 97e9f12

Please sign in to comment.
Something went wrong with that request. Please try again.