A reliable scraping schedule is more than a cron expression. This guide gives you a practical checklist for choosing run frequency, handling time zones and daylight-saving changes, preventing overlapping jobs, and planning retries without placing unnecessary load on a target site.
Overview
When you schedule a web scraping job, four decisions matter: when it should start, which time zone controls that start, what happens if the previous run is still active, and how failures are retried. Treating these as separate decisions makes a scraper easier to operate and troubleshoot.
A traditional cron expression usually contains five fields:
| Field | Allowed values | Meaning |
|---|---|---|
| Minute | 0–59 | Minute within the hour |
| Hour | 0–23 | Hour of the day |
| Day of month | 1–31 | Calendar day |
| Month | 1–12 | Month of the year |
| Day of week | 0–7 | Day of week; implementations may treat 0 and 7 as Sunday |
The asterisk means “any value,” while a comma lists values, a hyphen defines a range, and a slash defines an interval. For example, */15 * * * * means every 15 minutes in a five-field cron implementation. Because cron dialects differ, confirm the syntax supported by the host or cloud scheduler before deploying it. Some schedulers add a seconds field, a year field, named time zones, or special expressions.
A schedule should reflect the source's publishing rhythm and your data requirement, not simply run as often as possible. Before configuring a responsible web scraping workflow, check the target's terms, access guidance, rate limits, and expected request volume. A slower, predictable schedule is often easier to operate than a frequent job that creates bursts and overlapping work.
Checklist by scenario
Daily collection
- Choose a time after the source is likely to have published the day's updates.
- Use a fixed minute rather than starting exactly on a common hour boundary if your scheduler and target allow it.
- Record the intended time zone in configuration and documentation.
- Make the job idempotent so a rerun does not create duplicate records.
For example, 30 6 * * * requests a run at 06:30 every day in a standard five-field cron environment. The expression alone does not tell you whether that means UTC or local time; the scheduler's time-zone setting does.
Hourly or near-real-time collection
- Measure the normal runtime before selecting an interval.
- Leave enough time for a run to finish, or add an explicit concurrency lock.
- Limit pages, requests, and parallel workers per run.
- Store a checkpoint such as the last successful cursor, timestamp, or page.
15 * * * * runs at 15 minutes past every hour. For every 20 minutes, */20 * * * * is commonly used. These expressions describe launch times, not a guarantee that three or four runs cannot coexist. Concurrency must be controlled separately.
Weekly or low-change sources
- Schedule after the source's known update window, if one exists.
- Prefer a complete, verifiable collection over unnecessary frequency.
- Keep a change log so you can distinguish “no changes” from “the scraper failed.”
- Run a small health check more frequently if missing a weekly run would be costly.
0 4 * * 1 commonly represents 04:00 every Monday. Confirm how the scheduler interprets day-of-week values, especially if it supports both numeric and named values.
Multiple targets with different limits
- Give each target its own schedule, request budget, and retry policy.
- Use a queue or orchestrator when one scheduled trigger launches many independent tasks.
- Add jitter or staggered start times instead of launching every target simultaneously.
- Keep credentials and target-specific settings outside the cron expression.
A single scheduler entry can start an orchestration process, but that process should still enforce per-target concurrency and backoff. For selector, missing-page, and export checks, use the practices in the web scraper testing checklist.
What to double-check
Time zones and daylight saving time
Decide whether the schedule represents a business-local time or an absolute elapsed interval. UTC is often easier for infrastructure operations because it avoids seasonal clock changes, while a local time zone may be appropriate when the source publishes according to a regional calendar. Do not rely on the server's default time zone without documenting it.
- Write the time zone beside the schedule in configuration and runbooks.
- Use an explicit, supported time-zone identifier where the platform permits it.
- Test the transition into and out of daylight saving time.
- Decide what should happen if a local clock time occurs twice or does not occur.
- Check logs for the scheduler's recorded trigger time and the worker's start time.
Overlap prevention
Suppose a job runs every 15 minutes but normally takes 25 minutes. Without protection, a new worker can start before the previous one finishes. That can duplicate requests, compete for the same output file, and produce inconsistent checkpoints.
Use one or more of these controls:
- Distributed lock: acquire a lock with an expiry before starting; release it after completion.
- Single-worker deployment: useful for simple workloads, but verify that restarts do not leave stale locks.
- Queue-based work: put pages or targets into a queue and limit consumers.
- Idempotent writes: use stable record keys and upserts rather than blind inserts.
- Run timeout: stop or quarantine a stuck job so it cannot block operations indefinitely.
Log a run identifier, scheduled time, actual start time, finish time, item counts, and lock status. These fields make overlapping and missed runs visible rather than anecdotal.
Retries and failure handling
Separate transient failures from permanent failures. A temporary connection error, rate response, or service interruption may justify a delayed retry. An invalid selector, authentication failure, or malformed export should usually stop and alert rather than repeat immediately.
A practical retry template is:
- Attempt the request or task once.
- Retry a small, bounded number of times for explicitly transient errors.
- Increase the delay between attempts with backoff and add modest jitter.
- Record the final error and preserve enough context to reproduce it.
- Send the failed item or run to a dead-letter path for review.
- Let the next scheduled run proceed only if the checkpoint and output state are safe.
Do not use retries to bypass access controls or continually repeat a request that the target is rejecting. Authentication-dependent jobs should also have a clear failure path; the web scraping authentication guide covers the related cookie, session, and token considerations.
Common mistakes
- Assuming all cron is identical: field counts, special characters, and time-zone support vary. Test the exact scheduler syntax.
- Confusing launch frequency with completion frequency: a cron trigger does not wait for the prior process unless you implement that behavior.
- Leaving time zones implicit: server migrations and container defaults can change the observed run time.
- Retrying every error: repeated retries can amplify load and conceal a broken scraper.
- Overwriting a shared output: use temporary files, atomic moves, or transactional writes when a reader may access the output during collection.
- Skipping empty-result checks: a successful process with zero records may indicate a selector or access problem.
- Ignoring data quality: validate fields, dates, links, and missing records before treating a run as successful. See the scraped data quality checklist.
- Using one broad schedule for unrelated targets: target-specific timing and limits are easier to reason about when configuration is separated.
When to revisit
Review the schedule before seasonal planning cycles, after a source changes its publishing pattern, and whenever the scraper, hosting platform, or output pipeline changes. Also revisit it after a missed run, an overlap, an unexpected time-zone shift, or a sequence of retries.
For a repeatable review, work through this short checklist:
- Confirm the cron dialect, field count, and configured time zone.
- Compare the interval with current runtime, request volume, and target limits.
- Test the lock, timeout, checkpoint, and idempotent-write behavior.
- Trigger a controlled transient failure and verify bounded retries and alerts.
- Check daylight-saving behavior if the schedule uses local time.
- Verify that an apparently successful run produces complete, valid output.
- Update the runbook with the expression, time zone, owner, retry policy, and rollback steps.
Use a cron expression builder or a local test environment to inspect the next several trigger times, then verify those results against the cloud scheduler's documentation and logs. A schedule is ready for production when its timing is explicit, its workload is bounded, overlapping runs are controlled, and failures produce an actionable record.