Merge pull request #92 from alexbarcelo/targettimeprint

Fixing the print_notice for Next Backup when `DB_DUMP_BEGIN` is +XXX
This commit is contained in:
Dave Conroy
2021-12-13 17:27:58 -08:00
committed by GitHub

View File

@@ -438,9 +438,10 @@ print_debug "Backup routines Initialized on $(date)"
today=$(date +"%Y%m%d")
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
target_time=$(($current_time + $waittime))
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
target_time=$(($target_time + 24*60*60))
fi