You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behavior of the script does not align with the intended functionality. Specifically, the elif [[ -v BACKUP_CRON ]] block is not entered when the BACKUP_CRON variable is unset.
The intended behavior is for the script to handle the case where BACKUP_CRON is not set and to enter the elif block with a default value.
Steps to Reproduce
Run the script with the BACKUP_CRON environment variable unset.
Observe that the elif [[ -v BACKUP_CRON ]] block is not executed, and the script proceeds to the else block instead.
Expected Behavior
When the BACKUP_CRON variable is unset, the script should enter the elif block and set BACKUP_CRON to the default value (0 1 * * *) and apply the corresponding cron job.
Actual Behavior
When BACKUP_CRON is unset, the script skips the elif block and falls into the else block, applying the default crontab.txt instead.
Proposed Fix
Update the condition for the elif block to explicitly handle the unset BACKUP_CRON variable. Suggested change:
docker-borgmatic/root/etc/s6-overlay/s6-rc.d/svc-cron/run
Lines 43 to 60 in 9a8c38e
The current behavior of the script does not align with the intended functionality. Specifically, the
elif [[ -v BACKUP_CRON ]]
block is not entered when theBACKUP_CRON
variable is unset.The intended behavior is for the script to handle the case where
BACKUP_CRON
is not set and to enter theelif
block with a default value.Steps to Reproduce
BACKUP_CRON
environment variable unset.elif [[ -v BACKUP_CRON ]]
block is not executed, and the script proceeds to the else block instead.Expected Behavior
When the
BACKUP_CRON
variable is unset, the script should enter theelif
block and setBACKUP_CRON
to the default value (0 1 * * *
) and apply the corresponding cron job.Actual Behavior
When
BACKUP_CRON
is unset, the script skips theelif
block and falls into theelse
block, applying the defaultcrontab.txt
instead.Proposed Fix
Update the condition for the
elif
block to explicitly handle the unsetBACKUP_CRON
variable. Suggested change:The
[[ -z "${BACKUP_CRON+x}" ]]
check ensures that the block is entered whenBACKUP_CRON
is not set.Current Workaround
The current workaround that I found was to set the default value in the config too:
The text was updated successfully, but these errors were encountered: