mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-08-13 12:33:30 +02:00
ARI - Run cron job more frequently (#6939)
* ARI - Run cron job more frequently With ACME Renewal Info (RFC9773 §4.3), fetching renewal window should be more frequent, e.g. in case of revocation incident. "For instance, a server that needs to revoke certificates within 24 hours of notification of a problem might choose to reserve twelve hours for investigation, six hours for clients to fetch updated RenewalInfo objects, and six hours for clients to perform a renewal." More flexible option is to run the cron job every hour and only refresh ARI when the last one + Retry-After header is in the past. * Fix cron job schedule for certificate renewal * Fix random_hour syntax in cron job installation * Update Windows task scheduler to run more frequently Add support for randomized hour and update frequency Ref: * [/mo](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-create#to-schedule-a-task-to-run-every-n-hours) * [/SC HOURLY](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-create#parameters) * Add padding for StartTime (/ST) in SCHTASKS.exe * New Banner Updated README to include responsive images for dark and light modes. * rebase * Reset README --------- Co-authored-by: ZeroSSL-Andreas <andreas.schuster@hidglobal.com>
This commit is contained in:
parent
116c05fbff
commit
ced8d72808
1 changed files with 4 additions and 3 deletions
7
acme.sh
7
acme.sh
|
|
@ -6470,6 +6470,7 @@ _install_win_taskscheduler() {
|
|||
_lesh="$1"
|
||||
_centry="$2"
|
||||
_randomminute="$3"
|
||||
_randomhour="$4"
|
||||
if ! _exists cygpath; then
|
||||
_err "cygpath not found"
|
||||
return 1
|
||||
|
|
@ -6539,7 +6540,7 @@ installcronjob() {
|
|||
fi
|
||||
_t=$(_time)
|
||||
random_minute=$(_math $_t % 60)
|
||||
random_hour=$(_math $_t / 60 % 24)
|
||||
random_hour=$(_math $_t / 60 % 6)
|
||||
|
||||
if ! _exists "$_CRONTAB" && _exists "fcrontab"; then
|
||||
_CRONTAB="fcrontab"
|
||||
|
|
@ -6548,7 +6549,7 @@ installcronjob() {
|
|||
if ! _exists "$_CRONTAB"; then
|
||||
if _exists cygpath && _exists schtasks.exe; then
|
||||
_info "It seems you are on Windows, let's install the Windows scheduler task."
|
||||
if _install_win_taskscheduler "$lesh" "$_c_entry" "$random_minute"; then
|
||||
if _install_win_taskscheduler "$lesh" "$_c_entry" "$random_minute" "$random_hour"; then
|
||||
_info "Successfully installed Windows scheduler task."
|
||||
return 0
|
||||
else
|
||||
|
|
@ -6570,7 +6571,7 @@ installcronjob() {
|
|||
fi
|
||||
$_CRONTAB -l 2>/dev/null | {
|
||||
cat
|
||||
echo "$random_minute $random_hour * * * $lesh --cron --home \"$LE_WORKING_DIR\" $_c_entry> /dev/null"
|
||||
echo "$random_minute $random_hour,$(_math $random_hour + 6),$(_math $random_hour + 12),$(_math $random_hour + 18) * * * $lesh --cron --home \"$LE_WORKING_DIR\" $_c_entry> /dev/null"
|
||||
} | $_CRONTAB_STDIN
|
||||
fi
|
||||
if [ "$?" != "0" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue