// guides

Run a Python script automatically every day (Mac, Windows, Linux, GitHub Actions)

Four free ways to run a Python script on a schedule: cron, Windows Task Scheduler, launchd and GitHub Actions. Copy-paste examples, plus how to pass secrets safely.

Updated 2026-10-16 · about 10 minutes

Rather not set it up yourself? Describe your task in one sentence and we'll build and test it for you, free →

Steps

  1. macOS / Linux: cron

    Run crontab -e and add a line like:

    0 7 * * * cd /path/to/agent && set -a && . ./.env && set +a && /usr/bin/python3 script.py >> run.log 2>&1
    Always use full paths, because cron has a minimal environment.

  2. Windows: Task Scheduler

    Create Basic Task → Daily → Start a program: python, arguments script.py, and set Start in to the script folder. Store secrets with setx NAME value.

  3. Free cloud: GitHub Actions

    Add .github/workflows/run.yml with on: schedule: - cron: '0 7 * * *', a setup-python step and python script.py. Put secrets in repository secrets. Times are in UTC.

  4. Check it ran

    Read run.log, or the Actions tab. Laptops that are asleep miss cron runs, so use the cloud option if that matters.

  5. Start with something useful

    All our free agents are single-file Python scripts with no dependencies, built for exactly this.

Skip the setup: free download

The AI news digest agent does all of this. It's tested, MIT-licensed, and comes as an n8n workflow plus a Python script.

Get the free AI news digest agent → Or have us build yours →

FAQ

Will cron run if my laptop is asleep?

No. Use anacron, launchd's StartCalendarInterval, which runs missed jobs on wake, or GitHub Actions.

Is GitHub Actions free for this?

Public repos get free minutes, and a small daily script fits easily in the free tier for private repos too.

Related guides

New guides

Want one built for your task?

Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.

We'll only email you about your agent and TaskToAgent.