Schedule Python Scripts with Cron and Render
Run your scripts on a timer using cron locally or a free Render web service kept awake by a pinger.
By Dr. Dev2026-01-177 min read
π
Local cron
On Linux or macOS, crontab -e lets you schedule any command.
# every day at 08:00
0 8 * * * /usr/bin/python3 /home/me/clean.pyRender free web service
A small Flask app can expose a /run endpoint. An uptime monitor pings /health so the service stays awake, and a scheduler calls /run.
from flask import Flask
app = Flask(__name__)
@app.get('/health')
def health():
return {'ok': True}Remember
Free tiers sleep when idle and have limits. Never store secrets in code; use environment variables.