feat(shell-sync): run_cron_scheduler() part 3/3

This commit is contained in:
hoelee committed 2026-07-15 09:00:00 +08:00
1 parent d399abb1b5
commit ebb7df6585
1 file changed
+10
+10
View File
@@ -350,3 +350,13 @@ run_cron_scheduler() {
chmod 700 "$wrapper"
printf '%s %s >> /proc/1/fd/1 2>&1\n' "$SYNC_CRON" "$wrapper" > "$crontab_file"
if ! crontab "$crontab_file"; then
log "Configuration error: SYNC_CRON is not a valid cron expression: $SYNC_CRON"
return 1
fi
log "Starting cron schedule: $SYNC_CRON"
cron -f &
CRON_PID=$!
wait "$CRON_PID"
}