mirror of
https://github.com/ChrisSewell/MySQL-backup-to-Amazon-S3.git
synced 2025-07-01 18:47:26 -04:00
Have the script determine the period, rather than the cron.
This commit is contained in:
11
mysqltos3.sh
11
mysqltos3.sh
@ -16,9 +16,16 @@ MYSQLDUMPPATH=
|
|||||||
#tmp path.
|
#tmp path.
|
||||||
TMP_PATH=~/
|
TMP_PATH=~/
|
||||||
|
|
||||||
PERIOD=${1-day}
|
|
||||||
|
|
||||||
DATESTAMP=$(date +".%m.%d.%Y")
|
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."
|
echo "Selected period: $PERIOD."
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user