mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 13:23:12 +01:00
Merge branch 'master' of https://github.com/tiredofit/docker-db-backup
This commit is contained in:
@@ -420,7 +420,10 @@ move_backup() {
|
|||||||
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
||||||
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
||||||
export AWS_DEFAULT_REGION=ap-northeast-2
|
export AWS_DEFAULT_REGION=ap-northeast-2
|
||||||
aws s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
|
||||||
|
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
||||||
|
|
||||||
|
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
||||||
|
|
||||||
rm -rf ${tmpdir}/*.md5
|
rm -rf ${tmpdir}/*.md5
|
||||||
rm -rf ${tmpdir}/"${target}"
|
rm -rf ${tmpdir}/"${target}"
|
||||||
@@ -438,9 +441,10 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
today=$(date +"%Y%m%d")
|
today=$(date +"%Y%m%d")
|
||||||
|
|
||||||
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
||||||
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
||||||
|
target_time=$(($current_time + $waittime))
|
||||||
else
|
else
|
||||||
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
||||||
if [[ "$target_time" < "$current_time" ]]; then
|
if [[ "$target_time" < "$current_time" ]]; then
|
||||||
target_time=$(($target_time + 24*60*60))
|
target_time=$(($target_time + 24*60*60))
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user