diff --git a/platform/shell-sync/sync.sh b/platform/shell-sync/sync.sh index 98b38c8b..830333be 100644 --- a/platform/shell-sync/sync.sh +++ b/platform/shell-sync/sync.sh @@ -340,3 +340,13 @@ run_cron_scheduler() { local wrapper="${PID_DIR}/cron-sync-all.sh" local crontab_file="${PID_DIR}/sync.crontab" + # Cron starts commands with a minimal environment. Preserve this container's + # configuration in a root-only Bash wrapper so arbitrary ACCOUNT_N_* values work. + { + printf '#!/bin/bash\n' + export -p + printf 'exec /sync.sh sync-all\n' + } > "$wrapper" + chmod 700 "$wrapper" + printf '%s %s >> /proc/1/fd/1 2>&1\n' "$SYNC_CRON" "$wrapper" > "$crontab_file" +