mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 13:23:12 +01:00
Fix code for absolute time
This commit is contained in:
@@ -25,8 +25,12 @@ else
|
||||
target_time=$(($current_time + $waittime))
|
||||
elif [[ $DB_DUMP_BEGIN =~ ^[0-9]+$ ]]; then
|
||||
print_debug "DB_DUMP_BEGIN is an integer."
|
||||
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
||||
target_time=$(($current_time + $waittime))
|
||||
|
||||
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
||||
if [[ "$target_time" < "$current_time" ]]; then
|
||||
target_time=$(($target_time + 24*60*60))
|
||||
fi
|
||||
waittime=$(($target_time - $current_time))
|
||||
elif [[ $DB_DUMP_BEGIN =~ ^([0-9]{4})-([0-9]{2})-([0-9]{2})[[:space:]]([0-9]{2}):([0-9]{2}):([0-9]{2})$ ]];
|
||||
then
|
||||
# Extract year, month, day, hours, minutes, and seconds from DB_DUMP_BEGIN
|
||||
|
||||
Reference in New Issue
Block a user