mirror of
https://github.com/ChrisSewell/MySQL-backup-to-Amazon-S3.git
synced 2025-07-01 18:47:26 -04:00
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:
16
mysqltos3.sh
16
mysqltos3.sh
@ -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."
|
||||||
|
Reference in New Issue
Block a user