calculate rest-time

This commit is contained in:
Jakobus Schürz 2020-12-23 13:55:22 +01:00
parent e6de4c6796
commit 580006d849

View file

@ -98,7 +98,9 @@ EOF
return 3
fi
else
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours) not reached"
local seconds=$(( $(date "+%s") - $(date --date="${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours ago" "+%s") ))
logwarn "sync-intervall (${MSC_GIT_REPO_UPDATE_INTERVALL-${MSC_GIT_REPO_UPDATE_INTERVALL_DEFAULT}} hours, \
$((seconds/86400))" days" $(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds") left ) not reached"
return 2
fi
else