S
Saurav Danej
90-Day AI/ML LinkedIn Content System
← All days
80
Day 80 of 90Automation

Scheduling — cron, APScheduler, Airflow

POST 1 of 5 MorningAutomationConcept

Pick a scheduler by ops complexity

Three picks:

- cron — single server, linear jobs, no UI. Set-and-forget for personal automation.
- APScheduler — Python-native, runs in your app, persistent jobs. Mid-complexity.
- Airflow / Prefect / Dagster — DAGs, retries, monitoring, multi-server. Real production data pipelines.

Don't reach for Airflow for a single nightly script. Cron + a Python script is enough until it isn't.
#Automation#Python#WebScraping#AI#100DaysOfCode#Scheduling
POST 2 of 5 MiddayAutomationDeep dive

Cron syntax in 30 seconds

cron uses 5 fields: minute hour day-of-month month day-of-week.

- 0 9 * * 1-5 — every weekday 9am
- */15 * * * * — every 15 minutes
- 0 0 1 * * — first of every month, midnight
- @daily — shorthand for 0 0 * * *

Always set a logfile and a fail alert. A silent cron job that's been failing for a year is nobody's friend. Use crontab.guru if syntax confuses you.
#Automation#Python#WebScraping#AI#100DaysOfCode#cron
POST 3 of 5 AfternoonAutomationCode

APScheduler in 12 lines

Runs inside your Python app. Persists jobs to a DB / file. Survives restarts. Great for FastAPI / Flask apps that need scheduled tasks without an external scheduler.
#Automation#Python#WebScraping#AI#100DaysOfCode#APScheduler
POST 4 of 5 EveningAutomationTip

Always send a heartbeat alert when a job DOESN'T run

Most monitoring catches failures. The harder bug: the job stopped running entirely (machine off, cron disabled, container died).

Fix: dead-man's switch. Job pings a service every run. If service doesn't see a ping in N minutes, it alerts you.

Free services: healthchecks.io, dead-mans-snitch. Or a tiny endpoint of your own. One-line addition; saves you from silent stale data.
#Automation#Python#WebScraping#AI#100DaysOfCode#Monitoring
POST 5 of 5 NightAutomationRecap

Day 80 — scheduled, monitored, alive

Day 80 done.

- cron / APScheduler / Airflow by ops fit
- cron syntax in 30s
- 12-line APScheduler
- Dead-man's switch saves silent failures

Tomorrow (Day 81): Slack / email automation. The notifications that close the loop.
#Automation#Python#WebScraping#AI#100DaysOfCode#Scheduling